#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
#define PI 3.1415927
#define C 4.0/3.0
int main()
{
double r, ans;
while(cin >> r)
{
ans = C * PI * pow(r, 3);
cout << fixed;
cout << setprecision(3) << ans << endl;
}
return 0;
}
HDU 2002
最新推荐文章于 2021-06-23 13:56:03 发布
本文提供了一个使用C++编程语言实现的计算球体积的程序,通过包含必要的数学库,利用公式C * π * r^3计算球体积,并通过输入半径输出结果。

232

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



