public class java1224 {
: d; p% E @) D! {( i/ o- T& K
+ a! K; \- v8 a4 b' [0 W public void main(String[]arg){
2 |4 x; d8 u x; \ int r[]=new int[42];
# _8 [& |( q6 J9 ]0 n7 ~ for(int i=0;i<42;i++)
9 \, \4 f- v, J: v: L1 q {
. E4 p F+ w" u7 M2 C r[i]=i+1;* j1 y0 {$ |5 m- q, j
}4 n2 e9 R4 W. `, o/ Z* T' Q( A
for(int i=0;i<42;i++)( Z9 q! j* m8 o8 q
{
* \) a) j V6 I+ {; X int rr=(int)(Math.random()*42);
$ j2 b( J# D; `& o+ z int t=r[i];4 Q* n! a O( [4 g& O% b
r[i]=r[rr];# j# q* y% F& ?% A
r[rr]=t;
+ l3 o$ l% ?: G( E }, {. V1 `8 l" }9 e# H' \
for(int i=0;i<6;i++)
' v' Q; ^4 b( Y# {* r {
* n7 ^* o! Y; ]) s# i5 E) { //System.out.println("第"+(i+1)+"個號碼"+r[i]);8 r& l" n, u1 q( ~
System.out.printf("第%d個號碼:%02d",i+1,r[i]);7 `& j, g0 s" V* |* U/ Q' f: F- j/ \1 X& R
}
, T; C$ f' _6 j! e [' Q //System.out.println("特別號:"+r[6]);6 U3 S& X1 \! c9 A
System.out.printf("特別號:%02d\n",r[6]);
! \) a. A( P2 r; @6 [6 d+ P4 Y3 L }
3 n0 J( d) D. E, @
9 M. A. r3 V2 \" R6 |} |