public class TQC207 {
1 A2 ~, l$ c- Q; e- w: U$ G; o. k/ U% m4 Y6 M
. R' d, T" e; X3 r( j8 L; n* V public static void main(String[] args) {
6 i/ z' _' Y7 e. d/ r' V4 \ int sum=0, even=0, max=0, tmp=0;
`9 M$ T; d& M3 o8 h* o int[] nums = new int[args.length];
& T! M: f# v+ C# t* v# f try{" D3 f+ J; v- N# b2 ~! b% _
for(int i=0 ; i<args.length ; i++){
) {% h7 C. m- H4 _ tmp= Integer.parseInt(args[i]);
( n, [, W* Q1 x2 W6 O nums[i] = tmp;
8 A" N. G" n& A4 ~ sum += tmp;( h& i0 K6 |- ], l; q
if((tmp%2)==0)
. }: W5 _3 }1 o' C! ^, h even++;0 c1 |* ]- m8 @5 n
max=Math.max(max,tmp);7 ]! u# H5 h( X
8 I$ J9 ]: r/ W; v7 Z* k: t* W
}
: k! r6 C" F5 s( t& f; O System.out.println("最大值"+"="+max);. E" u3 X" T- |# X" O4 W
System.out.println("偶數的個數"+"="+even);
7 i# S! h# D1 M$ h System.out.println("數字總和"+"="+sum);) w0 u, D* V) o$ h' D
9 U( z# ]; T# v# @: V) a$ o" b, }$ ] " b& ^! d. l$ w3 i( s
}
$ J( {0 A. p* @9 q) d/ K8 v catch(Exception e){, I- m3 h- r* P1 t0 G
}
: T/ H: h( T( P8 R) ^# c, J: d, s }
. z' }( C% m" M! `4 A6 Z} |