public class java1224 {
# q7 `3 r) t" p
6 t& o) @" r+ Q public void main(String[]arg){; B1 j2 ^- |. L) g. ~
int r[]=new int[42];
7 h# Q) ]: q* y4 K( U% Y) P for(int i=0;i<42;i++); {; o4 g1 x4 r6 t
{
" N; F6 Q8 @1 K r[i]=i+1;! ^- V! b1 g4 t" H6 q
}, e, n/ y' |4 ?
for(int i=0;i<42;i++)! s. C2 v7 \& S; C3 U& \; }! ]
{
7 c# {; F3 O# W3 I int rr=(int)(Math.random()*42);
" H1 i. M W9 q* n, b+ m: Y6 v0 V int t=r[i];: H3 Q3 ?4 G+ g9 L5 s5 r
r[i]=r[rr];
9 N% U% l V1 B& @% M r[rr]=t;+ R& Z" C5 J4 }1 J
}
; X+ b9 H6 t( P) G5 c( u2 N for(int i=0;i<6;i++)4 u y- y& D! N7 m% B7 p
{
- E" t9 x% [% ^8 x( c* q6 x4 W, c/ A //System.out.println("第"+(i+1)+"個號碼"+r[i]);# q$ D: y! g- O. ^7 _2 t
System.out.printf("第%d個號碼:%02d",i+1,r[i]);8 V; U7 F C9 I2 D" E
}
, H" s4 d$ u8 b //System.out.println("特別號:"+r[6]);( o+ h! n1 _! ~( c4 `
System.out.printf("特別號:%02d\n",r[6]); 6 t/ ~3 X! M! R7 C
}$ S, l. E& g0 n: \/ S- @9 u
& S5 r9 Y$ F {8 O7 W
} |