1 条题解

  • 0
    @ 2023-6-11 12:16:44

    C++ :

    #include <iostream>
    using namespace std;
    int main()
    {
    	int a,b,c,t,s;
    	cin>>a>>b>>c;
    	if(a < b)
    	{
    		t = a;
    		a = b;
    		b = t;
    	}
    	if(a < c)
    	{
    		t = a;
    		a = c;
    		c = t;
    	}
    	if(b < c)
    	{
    		t = b;
    		b = c;
    		c = t;
    	}
    	s = a * b + b * c * 2 + a * c * 2;
    	cout<<s;
    	return 0;
    }
    

    Python :

    sr=input().split()
    a=int(sr[0])
    b=int(sr[1])
    c=int(sr[2])
    s=0
    s=(a*b+a*c+b*c)*2
    if a*b>a*c and a*b>b*c:
        s=s-a*b
    elif a*c>a*b and a*c>b*c:
        s=s-a*c
    else:
        s=s-b*c
    print(s)
    
    • 1

    【入门】做纸箱最少需要多少面积的硬纸板。

    信息

    ID
    2260
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者