展开全部
首先你的程序中体积公式就错了,你忘了除以3,要注意细节啊。还有输出格式不应32313133353236313431303231363533e59b9ee7ad9431333332636433该是%d,这与你前面定义的格式不符。你的程序可修改为:
#include
#include
#define PI 3.1415927
void main()
{
double fRadius,fHeight,fSquare,fVolume;
printf("Input the radius of the cone:\n");
scanf("%lf",&fRadius);
printf("Input the height of the cone:\n");
scanf("%lf",&fHeight);
fSquare=PI*fRadius*(fRadius+pow(fRadius*fRadius+fHeight*fHeight,0.5));
fVolume=PI*fRadius*fRadius*fHeight/3.0;
printf("The area of the cone is %.2f\n",fSquare);
printf("The volume of the cone is %.2f\n",fVolume);
}