import java.util.*;
import java.lang.*;
class Cylinder
{
double r,h;
double v,s;
double V(){
v=3.14*r*r*h;
return v;}
double S(){
s=3.14*r*r*2+2*r*3.14*h;
return s;}
}
class Test {
public static void main (String [] args){
Cylinder A=new Cylinder();
double v,s;
System.out.println("Please input the area and high");
Scanner scanf=new Scanner(System.in);
A.r=scanf.nextDouble();
A.h=scanf.nextDouble();
v=A.V();
s=A.S();
System.out.println("S is ="+s);
System.out.println("V is ="+v);
}
}
圆柱体
最新推荐文章于 2023-09-03 15:24:07 发布