您的位置:首页 > 其它

ComputeArea

2014-04-20 22:34 309 查看
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 );

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: