public class TQC207 {8 f3 d A- X5 z) c3 d
% |( z D6 s# q
3 T+ z" I. h& c( r9 x% P* @- g0 W
public static void main(String[] args) { / Y5 s e3 E3 W" f int sum=0, even=0, max=0, tmp=0; `: T; \; A: c) v2 P. E int[] nums = new int[args.length];! S. ?% q1 P& k' \5 U
try{" y5 `+ J% v5 x- w* l! z
for(int i=0 ; i<args.length ; i++){ ]/ c. ?& Q& i; Z8 [0 J tmp= Integer.parseInt(args[i]); ! u7 T; N; W$ L" U nums[i] = tmp; . b4 ^/ ^# K" _2 u5 H( z5 ~ sum += tmp; $ v% P3 H7 u: F' e if((tmp%2)==0) & L0 H6 y" U2 I) U even++;# O" S4 x1 z/ E. a
max=Math.max(max,tmp);/ S' Y- V& Y. t2 ]# j3 R" a7 i
; C% ~# O4 {5 w$ {% b } 2 o8 C; w9 C4 [: H System.out.println("最大值"+"="+max);3 T6 h6 l2 e _- W5 ~8 K
System.out.println("偶數的個數"+"="+even); % P6 T& ^& w! G7 `5 e System.out.println("數字總和"+"="+sum);' N5 Q# E8 N/ L# d0 K; {) h2 n
$ s, |. M( ?, `2 K3 {