10月5号

2017-10-10  本文已影响0人  17860780569

#include#define PI 3.14

double calculateVolume(int height,int radius);

int main()

{

int cHeight = 0;

int cRadius = 0;

double volume = 0.0;

printf("请输入圆柱体的高度:\n");

scanf("%d",&cHeight);

printf("请输入圆柱体底面圆的半径:\n");

scanf("%d",&cRadius);

volume = calculateVolume(cHeight,cRadius);

printf("圆柱体的体积是:%f\n",volume);

return 0;

}

double calculateVolume(int height,int radius)

{

double result = height*PI*radius*radius;

return result;

}

上一篇下一篇

猜你喜欢

热点阅读