返回列表 發帖

1217 輸入兩數值相加

代入兩個參數...
6 R0 ~# M, ?/ F7 x; Q; S: ?: o, ]- c* w* E) w- q# }
並且相加、減、乘、除

  1. public class d1217{
  2.     public static void main(String[] arg){
  3.             //if(arg.length<2)return ;
  4.                 try{
  5.                     System.out.println(Integer.parseInt(arg[0])+Integer.parseInt(arg[1]));
  6.                 }catch(Excrption e){
  7.                 System.out.println("參數不足"+e.toString());
  8.         }
  9. }
複製代碼
★ 嘉凱~~☆

TOP

public class d1217{+ r5 N; \8 M0 A2 B6 q4 o
  P, O7 `8 L# t# p3 c9 s. b/ i
    public static void main(String[] arg){$ L1 @4 l( A7 L5 }! M8 ?

" w& H6 {& N; {; b6 U/ D2 d            //if(arg.length<2)return ;* V' |4 \: O- S8 [+ v3 J
( j* H# _+ }4 d2 `
                try{
8 @8 e, u5 s7 f* O% N/ d, L7 V# K4 A& `1 {& H0 P" Z# N
                    System.out.println(Integer.parseInt(arg[0])+Integer.parseInt(arg[1]));, u8 N2 i( ?  Y8 Z: r9 Y) F. G
: d) C5 q) |5 {+ Y1 m
                }catch(Excrption e){8 Y* @0 X$ |. e% Z5 v2 j+ i  L( z
6 p; }! X0 O5 ~3 P8 [( q* Y
                System.out.println("參數不足啦"+e.toString());* T& G' C1 [$ ~/ z6 _- f

4 m+ }7 Z, W, `  }& I        }
& s/ Z2 W( b3 ]% O- L% Y
: _8 B2 M7 n- W% V: Y3 _5 j}
人平

TOP

返回列表