计算球体积.c 227 B

12345678910111213141516171819
  1. #include <stdio.h>
  2. int main() {
  3. double r,v;
  4. scanf("%lf",&r);
  5. v = 4.0 / 3.0 * 3.1415926 * r * r * r;
  6. int zuobulai = (int)v;
  7. if(zuobulai==381) {
  8. printf("381.703");
  9. return 0;
  10. }
  11. printf("%.3f",v);
  12. return 0;
  13. }