1 条题解

  • 0
    @ 2025-4-12 22:06:18

    C :

    #include <stdio.h>
    
    #define PI 3.1415926535
    
    int main(void) {
    	double r;
    	scanf("%lf", &r);
    	printf("%.2f\n%.2f\n", PI*r*r, 2*PI*r);
    	return 0; 
    }
    
    

    C++ :

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

    Pascal :

    Program ygjsb;
    const pi=3.1415926535;
      Var
       r,c,s:real;
      begin
       read(r);
       c:=2*pi*r;
       s:=pi*r*r;
       writeln(s:0:2);
       write(c:0:2);
      end.
    
    • 1

    第二章:实数运算《练习6:求圆的面积》

    信息

    ID
    2914
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者