C语言在线作业编程题2:计算圆柱体的体积和表面积
#include<stdio.h>
#define PI 3.14159
int main()
{
float r,h;
float volume,area;
scanf("%f%f",&r,&h);
volume=PI*r*r*h;
area=2*PI*r*(h+r);
printf("volume=%.3f, area=%.3f\n", volume,area );
}
C语言在线作业编程题2:计算圆柱体的体积和表面积
#include<stdio.h>
#define PI 3.14159
int main()
{
float r,h;
float volume,area;
scanf("%f%f",&r,&h);
volume=PI*r*r*h;
area=2*PI*r*(h+r);
printf("volume=%.3f, area=%.3f\n", volume,area );
}