import javax.swing.*;
public class ComputeArea
{
public static void main(String args[])
{
final double PI=3.14159;//常量PI
double area;
int y;
String s=(String)JOptionPane.showInputDialog(null,"请输入一个数","输入对话框",
JOptionPane.PLAIN_MESSAGE,null,null,null);
y=Integer.parseInt(s);
area=PI*y*y;//圆的面积
System.out.println("The area for the circle of y is "+area );
}
}
ComputeArea
最新推荐文章于 2022-04-12 22:10:42 发布