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 ); } }
相关文章推荐
- 设计模式24——行为型模式之访问者模式
- Learn Java for Android Development Second Edition 笔记(一)
- AdditionQuiz
- 静走天后宫,食购十四涌
- TouchType
- 关于sqlite3使用top的一些规则总结
- 浅谈我对“活在当下”的理解
- [Unity3D]Unity3D游戏开发之基于Trigger的触发式动画设计
- 长生不老之术???
- Morris病毒
- NSPredicate的用法
- Head First: 装饰者模式
- HTTP请求格式和HTTP响应格式
- jstl学习笔记
- ubuntu查看端口
- malloc,calloc,realloc函数区别
- 编译性语言和解释性语言
- 设计模式23——行为型模式之模板方法模型
- PHP之preg_replace()与ereg_replace()正则匹配比较讲解
- 修改/etc/fstab后不重启且生效的方法