- 648 名前:デフォルトの名無しさん mailto:sage [2007/03/27(火) 20:21:11 ]
- >>639
public class kadai13 { public static void main(String[] args) { try { int a = Integer.parseInt(args[0]); if(a <= 62) { System.out.println("2の" + a +"乗は"+ Math.pow(2, a) +"です。"); } else System.out.println("2の2乗までしか計算できないよ。"); }catch (NumberFormatException e) { System.err.println("数字を渡せ!"); } } }
|

|