返回列表 發帖

1217 輸入兩數值相加

代入兩個參數...
. S$ o8 [& w+ b+ e8 i4 l3 t
8 f) B) r* A4 o1 d6 ~4 Y並且相加、減、乘、除

  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{
* `) t0 {0 |9 u' t7 o: x# a% y0 T1 G. c# J; v
    public static void main(String[] arg){
) `  b4 @8 @. q, F- }
7 ]* ~, g- m* `: s1 z; \            //if(arg.length<2)return ;* F% P7 \. P4 ?4 m) G( o+ U

0 t* U3 X( n3 c8 d                try{
; ~; s" n) a8 V- z5 G: `. y- W& Y! f
                    System.out.println(Integer.parseInt(arg[0])+Integer.parseInt(arg[1]));
: r& N  z( z( S, \4 l8 M( k
0 M8 }  `, Z  j' u- x5 X0 A" j                }catch(Excrption e){7 G- A% f! K6 U% W2 t; c. X8 H
/ U6 _5 @$ l, X1 B+ `9 S
                System.out.println("參數不足啦"+e.toString());9 R: @. i- t8 P3 p

3 S; a' L! K+ H* D. J        }# M: q8 t0 H4 H! t% K8 ^$ K* k

  I+ k4 w8 ~+ T# q" |" e* A: r+ v1 v( t}
人平

TOP

返回列表