8 条题解

  • 8
    @ 2022-12-24 18:23:56
    #include <bits/stdc++.h> 
    using namespace std; 
    int main() 
    { 
        double n, m, y, h, c; 
        cin >> n >> m; 
        y = n * n;
        h = m * m; 
        c = y - h; 
        cout << c * 3.14;
        return 0;
    }
    

    下面那位没写乘号 image

    • @ 2022-12-27 14:21:03

      能解出来就不错了,这毕竟是草稿,而且理论上说nn,mm算对。

  • 1
    @ 2023-10-1 10:16:27

    方法1:

    #include <cstdio>
    using namespace std;
    int main(){
        double R,r;
        scanf("%lf%lf",&R,&r);
        printf("%.2lf\n",3.14*(R*R-r*r));
        return 0;
    }
    

    方法2:

    #include <iostream>
    #include <iomanip>
    using namespace std;
    int main(){
        double R,r;
        cin>>R>>r;
        cout<<fixed<<setprecision(2)<<3.14*(R*R-r*r)<<endl;
        return 0;
    }
    

    方法3:

    #include <iostream>
    using namespace std;
    int main(){
        cout<<452.16<<endl;
        return 0;
    }
    

    PS:方法三很好

    • 1
      @ 2023-9-27 23:47:51
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          double r1,r2;
          cin>>r1>>r2;
          double s=(r1*r1-r2*r2)*3.14;
          cout<<fixed<<setprecision(2)<<s;
          return 0;
      }
      
      • 1
        @ 2023-9-8 21:20:21
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            double a , b ,c;
            cin >> a >> b;
            a = 3.14 * a * a;
            b = b * b * 3.14;
            c = a - b;
            printf("%.2f",c);
            return 0;
        }
        
        • 0
          @ 2024-2-3 8:50:40

          假设大家学习过小学圆面积公式,那就不难推导出圆环面积公式: S=πr1²-πr2² =π(r1²-r2²) 所以核心代码为:

          cin>>r1>>r2;
              cout<<(r1*r1-r2*r2)*3.14;
          

          AC代码:

          #include<bits/stdc++.h>
          using namespace std;
          int r1,r2;
          int main(){
              cin>>r1>>r2;
              cout<<(r1*r1-r2*r2)*3.14;
              return 0;
          }
          
          • 0
            @ 2023-8-23 11:24:16

            上面的,太逊辣!image

            过辣!

                double R,r;//公式:π(R²-r²)
                cin>>R>>r;
                cout<<fixed<<setprecision(2)<<1.0 * 3.14 * ( pow(R,2) - pow(r,2) );
            
          • -4
            @ 2022-9-1 17:34:07
            printf("%.2f",3.14*awa*awa-3.14*qwq*qwq);
            
            • -4
              @ 2022-6-5 10:37:22

              #include <bits/stdc++.h> using namespace std; int main() { double n,m,y,h,c; cin>>n>>m; y=nn; h=mm; c=y-h; cout<<c*3.14; }

              • 1

              信息

              ID
              335
              时间
              1000ms
              内存
              16MiB
              难度
              1
              标签
              递交数
              274
              已通过
              184
              上传者