计算圆柱体积
程序员文章站
2022-07-07 11:26:38
...
#include<stdio.h>
double cylinder(double r, double h)
{
double result;
result=3.1415926*r*r*h;
printf("Volume=%.3f\n",result);
return result;
}
int main()
{
double height, radius, volume;
printf("Enter radius and height:");
scanf("%lf %lf",&radius,&height);
cylinder(radius,height);
return 0;
}
#include<stdio.h>
double cylinder(double r, double h);
int main()
{
double height, radius, volume;
printf("Enter radius and height:");
scanf("%lf %lf",&radius,&height);
volume=cylinder(radius,height);
printf("Volume=%.3f\n",volume);
return 0;
}
double cylinder(double r, double h)
{
double result;
result=3.1415926*r*r*h;
return result;
}
上一篇: 从RTP包中解析AAC数据
下一篇: 读入圆柱体的半径和高,计算圆柱体的体积。