计算球体积

package com.test;
import java.util.*;
import java.io.*;
public class Main
{
   public static void main(String [] args)
   {
       Scanner sc=new Scanner(System.in);
       double d,r; 
       String result;
       while(sc.hasNextDouble())
       {
       r=sc.nextDouble();
       d=(4.0/3)*3.1415927*Math.pow(r, 3);
       result= String.format("%.3f",d);
       System.out.println(result);
       } 
     }
   }


原文地址:https://www.cnblogs.com/gavanwanggw/p/7306397.html