1 solutions

  • 0
    @ 2025-11-5 17:31:34

    C :

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

    C++ :

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

    Pascal :

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

    第二章:实数运算《练习7:求圆柱体表面积》

    Information

    ID
    18519
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By