1 solutions

  • 0
    @ 2025-3-3 16:33:40

    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

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

    Information

    ID
    10649
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By