public class TQC207 {: _5 W, Y% S/ |! S
) P! e: t. @# z( |% i" P; t. a2 m/ h
' [( D) Y* U2 A/ z$ z; @/ m* T' v: {# w public static void main(String[] args) {6 ]. o7 u7 I" b8 i1 q
int sum=0, even=0, max=0, tmp=0;
$ h6 K5 e4 u/ T9 G; s int[] nums = new int[args.length];
/ f0 @2 C3 g, Y1 z" {8 h try{! j/ v+ V2 i0 S% S" J
for(int i=0 ; i<args.length ; i++){ y9 |' u; m' m1 }* V) _, [) ?- K
tmp= Integer.parseInt(args[i]);
7 |9 f' ~$ y' m6 f$ `3 m$ q4 c nums[i] = tmp;0 Y" H! ~: X+ I' L( P
sum += tmp;
* r# s( W$ k/ Y if((tmp%2)==0)
- b* [5 a/ K: k3 Q6 G- W even++;7 m6 X3 Z `9 F+ K. x
max=Math.max(max,tmp);
1 `! k% ~$ P9 K l* V ! n0 E% F/ Q2 C3 Z0 d# f
}
- g% f0 ]* O8 D d' ^+ [' A System.out.println("最大值"+"="+max);$ u7 i/ W$ O7 e) p
System.out.println("偶數的個數"+"="+even);! [+ m! ^4 I9 y" F7 N5 T
System.out.println("數字總和"+"="+sum);! k6 t" q+ u. e# q3 P1 _( |4 ^8 S
W! t; p& X h: A
& }. O+ e. ~! U: K4 W, b( Z6 V }9 j v5 V" w2 ]3 p. r6 L% q
catch(Exception e){
, L! w' } ?/ \/ g4 V }
& w$ S7 t! `( _6 {3 ~ }3 D+ d" J4 O7 u. t
} |