public class TQC207 {
" |3 Z4 R3 j7 ~
! j- ]) c0 e' S7 K, }/ y' t" H
7 C" l- m. ~2 i" H1 a, e public static void main(String[] args) {3 W( j+ r/ C) _+ l6 b/ k
int sum=0, even=0, max=0, tmp=0;! W O" j4 x6 g) y- O
int[] nums = new int[args.length];3 k+ G4 _6 l1 a- j' H6 @/ h( e. }! e
try{
0 {. T' L6 [/ ^( Z) a for(int i=0 ; i<args.length ; i++){
* E% }; ^, X7 U6 s* l tmp= Integer.parseInt(args[i]);; }+ ^1 z* w8 ~9 Y
nums[i] = tmp;) T7 A, {$ l. J- L+ h
sum += tmp;5 @! J% r% f" X' O
if((tmp%2)==0)/ U! _* W: ] _* x; Q
even++;
' Z0 ?8 K) M* J5 ~8 { max=Math.max(max,tmp);
8 w4 Q0 L% ]5 {- I0 K
) u' ?1 S, G& z }
; g1 X* O Z% O7 O! A$ c System.out.println("最大值"+"="+max);
4 {) b [1 g9 O. T# V% B; S6 H System.out.println("偶數的個數"+"="+even);
5 v. C2 H5 |7 U$ w* m3 P, x System.out.println("數字總和"+"="+sum);+ H( i# ~& I0 W8 M& b% E& U
% ?# ]" {5 c( g9 [& K" o" V2 R - Q7 \2 L5 }1 Q' z
}
j8 a2 B, c3 z% F3 J% O catch(Exception e){
n( t+ k+ {8 U }
. x/ ?/ P7 |: i# M& c }) f/ P$ @2 k P$ ] O6 a
} |