根据输入的半径值,计算球的体积。

思路:用pow函数,定义pi

#include <stdio.h>
#include <stdlib.h>
#include"math.h"
#define PI 3.1415927

int main()
{
double r,c;
while(scanf("%lf",&r)!=EOF)
{
c=pow(r,3);
c=4*PI*c/3;
printf("%.3lf ",c);
}

return 0;
}

原文地址:https://www.cnblogs.com/zhs314159/p/10322759.html