发布网友 发布时间:2022-04-23 08:47
共2个回答
热心网友 时间:2022-06-18 13:44
#include<stdio.h>
#include<math.h>
int main()
{
double pai = 2*acos(0);
double r,h;
double s1,s2,v;
scanf("%lf %lf",&r,&h);
s1 = pai*r*r;
s2 = 2*s1+pai*2*r*h;
v = s1*h;
printf("底面积:%.2lf 体积: %.2lf 表面积:%.2lf\n",s1,v,s2);
return 0;
}
望采纳!
热心网友 时间:2022-06-18 13:44
#include<stdio.h>
#define pi 3.1415926
int main()
{float r,h,s1,s2,v;
scanf("%f%f",&r,&h);
s1=pi*r*r;
v=s1*h;
s2=2*s1+2*pi*r*h;
printf("s1=%f\nv=%f\ns2=%f\n",s1,v,s2);
return 0;
}