📄 powerdemo.java
字号:
//==============================================================
// PowerDemo.java - Using the Math class pow() method
//
// Java学习源代码检索系统 Ver 1.0 20031015 免费正式版
// 版权所有: 中国IT认证实验室(www.ChinaITLab.com)
// 程序制作: ChinaITLab网校教研中心
// 主页地址: www.ChinaITLab.com 中国IT认证实验室
// 论坛地址: bbs.chinaitlab.com
// 电子邮件: Java@ChinaITLab.com
//==============================================================
class PowerDemo {
public static void main(String args[]) {
if (args.length < 2) {
System.out.println("Enter two values as follows:");
System.out.println("java PowerDemo 2 8");
} else {
try {
int j = Integer.parseInt(args[0]);
int k = Integer.parseInt(args[1]);
System.out.println(j + " ^^ " + k + " = " + Math.pow(j, k));
}
catch (NumberFormatException e) {
System.out.println("Error in argument " + e.getMessage());
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -