Java計算圓的容積和體積
package project
import java.net.SocketTimeoutException;
public class test {
????static String test1="hello";
????public static void main(String[] args){
????????String test2="world";
????????System.out.println("hello world!");
????????int r =5,h = 3 ;
????????double area=Math.PI*r*r;
????????double volume=area*3;
????????double rom=volume*750;
????????System.out.println("體積大小是:"+volume);
????????System.out.println("容積大小是:"+rom);
}
}
標簽: