这一题也是我打Saber看到的
思路:直接输出 (4/3.0) * π * r^3(r 的 立方)
不多BB,C++代码:
#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159;
int main()
{
int r;
cin >> r;
cout << fixed << setprecision(3) << "VOLUME = " << (4/3.0) * PI * pow(r,3);
return 0;
}
2022.8.5 淼题解 (2/3)