【杭电2002】计算球体积

来源:互联网 发布:住户部门贷款数据 编辑:程序博客网 时间:2024/04/23 15:29

这里写图片描述
pow函数都是浮点型参数。你也可以直接列公式

#include<stdio.h>#include<math.h>#define PI 3.1415927int main() {    double i,j;    while(scanf("%lf",&i)!=EOF)    {    j=PI*pow(i,3)*4/3;    printf("%.3f\n",j);    }    return 0;}

http://acm.hdu.edu.cn/showproblem.php?pid=2002

0 0