用JAVA编写程序,输入半径和高,通过圆柱的底面积公式和体积公式来计算圆柱的底面积和体积!
eg:
代码:
import java.util.Scanner;
public class bb{
public static void main(String[] args){
final double PI = 3.14159;
System.out.print("please input radius and height:");
Scanner input = new Scanner(System.in);
double radius = input.nextDouble();
double height = input.nextDouble();
double area = PI * radius * radius;
double volumn = area * height;
System.out.println("The area is "+area);
System.out.println("The volumn is "+volumn);
}
}
结果:
原文:/ncuhwxiong/p/5846897.html
如果觉得《java圆柱的底面积体积 计算圆柱的底面积和体积》对你有帮助,请点赞、收藏,并留下你的观点哦!