地址
http://acm.hdu.edu.cn/showproblem.php?pid=2002
定位
数学题
水题
分析
-
V=43πr3
代码
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- #include <string.h>
- #define PI 3.1415927
- using namespace std;
- int main() {
- double r;
- while(scanf(“%lf”,&r)!=EOF) {
- double tmp=PI*pow(r,3)*4/3;
- printf(”%.3lf\n”,tmp);
- }
- return 0;
- }
性能
| Exe.Time | Exe.Memory | Code Length | Language |
|---|---|---|---|
| 0MS | 1872K | 287B | c++ |
本文介绍了一道简单的数学题目——球体体积的计算,并提供了使用C++编程语言的实现方法。通过输入球体的半径,程序能够准确计算并输出球体的体积。
527

被折叠的 条评论
为什么被折叠?



