描述根据输入的半径值,计算球的体积。
1
1.5
4
14
1 import java.util.Scanner; 2 3 public class Main { 4 public static void main(String[] args) { 5 Scanner scanner=new Scanner(System.in); 6 double PI=3.1415926; 7 double r; 8 double tiji; 9 10 while(scanner.hasNext()){ 11 r=scanner.nextDouble(); 12 tiji=4*PI*r*r*r/3; 13 System.out.printf("%.0f\n",tiji); 14 } 15 } 16 }
原文:http://www.cnblogs.com/zqxLonely/p/4132343.html