7 条题解

  • 2
    @ 2023-1-2 16:42:58

    超简代码 #include<bits/stdc++.h> using namespace std; int main() { int r; cin>>r; printf("%.2f\n",rr3.1415926); printf("%.2f",r23.1415926); return 0; }

    • 2
      @ 2022-12-28 12:30:10

      简短代码

      
      #include <bits/stdc++.h>
      using namespace std;
      double r;
      int main()
      {
      cin>>r;
      printf("%.2f",r*r*3.1415926);
      cout<<endl;
      printf("%.2f",2*3.1415926*r);
      return 0;
      }
      
      
      • 2
        @ 2022-12-25 20:38:34

        #include<bits/stdc++.h>//头文件

        using namespace std;

        int main()

        {

        double r,d,c,s,pi=3.1415926;//定义半径,直径,周长,面积和pi值

        cin>>r;//输入半径

        d=r*2;//求出直径

        c=2pir;//求出周长

        s=pirr;//求出面积

        printf("%.2lf\n%.2lf\n",s,c);//用printf函数结尾

        return 0;

        }

        • 2
          @ 2022-12-9 0:58:44

          C :

          #include <stdio.h>
          int main(){
          	int n;
          	scanf("%d",&n);
          	
          	printf("%.2f\n%.2f",3.1415926 * n * n,3.1415926*2*n);
          
          
          	return 0;
          }
          

          C++ :

          #include <iostream>
          #include <iomanip>
          
          using namespace std;
          
          int main(){
          	int r;
          	cin>>r;
          	double pi = 3.1415926,s,c;
          	s = pi * r * r;
          	c = pi * 2 * r;
          	cout<<fixed<<setprecision(2)<<s<<endl;
          	cout<<fixed<<setprecision(2)<<c<<endl;
          	return 0;
          }
          

          Python :

          r = int(input())
          s = 3.1415926 * r * r;
          c = 3.1415926 * r * 2;
          print('%.2f' % s)
          print('%.2f' % c)
          
          • 0
            @ 2023-4-13 21:27:55

            image

            • 0
              @ 2023-4-7 18:43:16

              S=3.1415926*半径的平方

              周长=3.1415926半径2

              • 0
                @ 2023-2-19 22:28:00
                #include <bits/stdc++.h>
                using namespace std;
                int main()
                {
                    double n;
                    cin>>n;
                    printf("%.2f",3.1415926*n*n);
                    cout<<endl;
                    printf("%.2f",2*n*3.1415926);
                	return 0;
                }
                
                • 1

                【入门】已知一个圆的半径,求解该圆的面积和周长

                信息

                ID
                41
                时间
                1000ms
                内存
                16MiB
                难度
                6
                标签
                递交数
                306
                已通过
                87
                上传者