返回列表 發帖

1217 輸入兩數值相加

代入兩個參數...
9 C' j2 D1 [" G0 z4 D( F' G) \$ F0 g9 g
並且相加、減、乘、除

  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{
4 N+ ~$ l' n5 h! R* C# I0 i8 r* f
( [6 y4 k: |  U/ ~    public static void main(String[] arg){
2 b8 b; |2 s: w6 r& P0 D0 Y& S) z6 p+ j, P7 [; o) T& f3 J4 {
            //if(arg.length<2)return ;8 s2 R+ p5 d$ P6 ~
5 c) N- ?  m1 N0 S7 s* s. J
                try{- a+ _7 R- R1 o$ {" M8 Q

" M7 d) e* l& x  K                    System.out.println(Integer.parseInt(arg[0])+Integer.parseInt(arg[1]));  o5 X. h! K6 O# W; n; _9 U
1 w8 E( o. x0 y6 t6 p/ q
                }catch(Excrption e){! [$ b( l& M1 k) |9 c
* C/ H5 K. J: f7 i. I( r* O
                System.out.println("參數不足啦"+e.toString());
/ S6 @& G. }/ s- H+ \9 ]
) N5 ]* M7 ~& l3 q* C$ L        }
  @/ G0 L$ w9 |; F# U
& X8 t" A0 ]/ |3 v+ [# x* |! U}
人平

TOP

返回列表