3 条题解

  • 1
    @ 2024-4-20 21:35:24
    #include<iostream>
    #include<iomanip>
    using namespace std;
    int main()
    {
        int r;
        cin >> r;
        double pi=3.1415926,s,c;
        s=pi*r*r;
        c=2*pi*r;//套用公式
        cout << fixed << setprecision(2) << s << endl << c;
        return 0;
    }
    
    • 0
      @ 2023-8-30 20:58:58

      求圆的面积和周长 题解

      1)审题 已知一个圆的半径,求解该圆的面积和周长 pai=3.1415926

      输入:半径

      输出:面积 周长

      2)代码

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          double r;
          cin >> r;
          double pi= 3.1415926;
          cout << setprecision(2) << fixed << 1.0 * pi * r * r;
          cout << /n;
          cout << setprecision(2) << fixed << 1.0 * pi * 2 * r;
          return 0;
      }
      

      点个赞吧 拜拜

    • -1
      @ 2023-7-18 11:34:20

      `

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          double r;
          cin >> r;
          double pai = 3.1415926;
          cout << setprecision(2) << fixed << 1.0 * pai * r * r;
          cout << endl;
          cout << setprecision(2) << fixed << 1.0 * pai * 2 * r;
          return 0;
      }
      
      • 1

      信息

      ID
      274
      时间
      1000ms
      内存
      16MiB
      难度
      6
      标签
      递交数
      1521
      已通过
      410
      上传者