- 论坛徽章:
- 0
|
package com.vev.bbs;
import javax.swing.JOptionPane;
public class Ientger {
public static void main(String[] args) {
String
nStr
=
JOptionPane
.showInputDialog("输入一个
整数
:");
int n = Integer.parseInt(nStr);
int dd = n * n;
JOptionPane.showMessageDialog(null, nStr + " 的平方为:" + dd, "标题:次方值",
JOptionPane.PLAIN_MESSAGE);
int cc=n*n*n;
JOptionPane.showMessageDialog(null, nStr + " 的立方为:" + cc, "标题:次方值",
JOptionPane.PLAIN_MESSAGE);
int
bb=n*n*n*n;
JOptionPane.showMessageDialog(null, nStr + " 的四次方为:" + bb, "标题:次方值",
JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/48326/showart_1096185.html |
|