5 条题解

  • 1
    @ 2024-12-22 18:51:01

    具体见第五题,但是第五题保留整数要四舍五入,这题它直接写个保留两位小数然后结束了。

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	float a,b,h;
    	cin>>a>>b>>h;
    	float qwq;
    	cin>>qwq;
    	printf("%.2f",(a*b+a*h*2+b*h*2-qwq)*11);//这行在第五题的基础上改改就完了
    	return 0;
    }
    
    • 1
      @ 2024-12-22 11:21:15

      c++:

      #include<bits/stdc++.h>
      using namespace std;
      double a,b,c,d;
      int main(){
      	cin>>a>>b>>c>>d;
      	printf("%.2f",(a*c*2+b*c*2+a*b-d)*11);
      }
      
      • 1
        @ 2024-12-22 11:20:53

        被坑害了。要保留两位小数,而且还没有地板。

        #include<bits/stdc++.h>
        #define int long long
        #define INF 0x3f3f3f
        using namespace std;
        double a,b,c,d;
        signed main(){
        	cin>>a>>b>>c>>d;
        	double x=a*b+a*c*2.0+b*c*2.0-d;
        	printf("%.2lf",x*11.0);
        	return 0;
        }
        
        • @ 2024-12-22 11:23:34

          这不是和校园OJ平台同题吗?

        • @ 2024-12-22 18:49:48

          一眼丁真,你怕不是直接复制第五题没看题然后挂了()

      • 1
        @ 2024-12-22 11:03:52

        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'))
        
        • 0
          @ 2024-12-27 21:15:19

          与第 55 题类似:

          #include<bits/stdc++.h>
          using namespace std;
          signed main(){
          	double a,b,c,d;
          	cin>>a>>b>>c>>d;
          	printf("%.2lf",(a*b+a*c*2+b*c*2-d)*11);
          }
          
          • 1

          信息

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