/*设圆半径r=1.5,圆柱高h=3,求圆周长、圆面积、圆球表面积、圆球体积、圆柱体积
取小数点后2位数字*/
#define PI 3.14
#include <stdio.h>
#include <windows.h>
#include <math.h>
int main(){
float r,h,yc,ym,qb,qt,zt;
printf("请输入圆的半径和圆柱的高;\n");
scanf("%f %f",&r,&h);
yc = 2.0*PI*r;
printf("圆周长是:%7.2f\n",yc);
ym = PI*pow(r,2.0);
printf("圆面积是:%7.2f\n",ym);
qb = 4*PI*pow(r,2.0);
printf("圆球表面积是:%7.2f\n",qb);
qt = 3.0/4*PI*pow(r,3.0);
printf("圆球体积是:%7.2f\n",qt);
zt = PI*pow(r,2.0)*h;
printf("圆柱体积是:%7.2f\n",zt);
}
Hao strong C programming p84 seventh title
in memory of today 2020.2.29
today has a lot to do with Neco I only dare to say so much about a blessing for our children