返回列表 發帖

1217 輸入兩數值相加

代入兩個參數...
/ h+ B2 C% R0 Q' q4 j; B5 K& p+ i+ H. b( X6 }3 _( L- u
並且相加、減、乘、除

  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{" q$ l! r' s1 n2 _: a, K! I  x5 z# {$ e
4 P9 L8 W- I" p" Z
    public static void main(String[] arg){  H' g' H! K, Q* Z2 F8 E/ g
' F' A9 Q& U3 L  e/ i
            //if(arg.length<2)return ;
+ C  s* z, b" i* q& p. _; n0 d3 l% }& E6 C" A9 c' v: d
                try{
6 g' u% o# F" l* N$ I; G( y) b5 U7 Q' J: M, W! n
                    System.out.println(Integer.parseInt(arg[0])+Integer.parseInt(arg[1]));" Z- ]0 M% C" J) a& S+ Z+ t
/ l# @9 N# q& V5 t3 c1 O
                }catch(Excrption e){) P8 T8 s* w/ _& C3 U% h! T
% H: x6 K3 B/ M5 U' `# U
                System.out.println("參數不足啦"+e.toString());* M1 d& V$ w8 O7 s

1 R  w& V2 D: s. ?- m1 V0 K3 q' s5 j5 u        }
6 \" S/ }  G+ R# f: f+ n% ?0 ]3 W) f5 P9 ~+ }+ W6 Y, A( ^
}
人平

TOP

返回列表