1030计算球的体积

 1 #include<cstdio>
 2 using namespace std;
 3 const double pi=3.14;//定义常量,当pi精确度发生更改时,只要改此处 
 4 int main()
 5 {
 6     double r,v;
 7     scanf("%lf",&r);
 8     v=4*pi*r*r*r/3;
 9     printf("%.2lf",v);
10     return 0;
11 }

入门小朋友注意第3行常量定义的方法

原文地址:https://www.cnblogs.com/tflsnoi/p/7966060.html