1 条题解

  • 0
    @ 2024-12-24 9:14:28

    C++ :

    #include<iostream>
    #include<iomanip>
    using namespace std;
    
    double a,b,c,k;
    double cost;
    int main(){
    	//freopen("fen.in","r",stdin);
    	//freopen("fen.out","w",stdout);
    	cin >> a >> b >> c >> k;
    	cost=(a*b+a*c*2+b*c*2-k)*11;
    	cout << fixed << setprecision(2)<<cost;
    } 
    

    Python :

    # coding=utf-8
    a=input().split()
    for i in range(4):
        a[i]=float(a[i])
    s=a[0]*a[1]+2*a[0]*a[2]+2*a[1]*a[2]-a[3]
    ans=s*11
    print(format(ans,'.2f'))
    
    • 1

    信息

    ID
    420
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    2
    已通过
    2
    上传者