public class java1224 {# M+ r% h z+ N8 t4 i
8 o! g0 }' c% O7 }/ H' N public void main(String[]arg){- D- v& H1 f, y5 x
int r[]=new int[42];6 B6 g; t2 Y+ p/ M$ {+ _
for(int i=0;i<42;i++)' H4 a5 C) S4 l1 ?# A2 w" c
{/ |1 V3 W9 O2 P5 q7 q' l
r[i]=i+1;- u* v) X6 L, J4 H' y$ B; [
}
# E# z4 q" i! a- ?. y: V4 @* H% [ for(int i=0;i<42;i++)1 m' N1 v% U- p
{
" [7 a, l( Z' u int rr=(int)(Math.random()*42);. J$ }& z5 \2 _# B9 d- {
int t=r[i];; g. `0 W: ?- r6 g) q
r[i]=r[rr];9 R1 D6 [/ ]4 T) h, u
r[rr]=t;
; Y2 E. b2 N }9 ~/ e4 N8 q }
x3 b4 y7 M! c( G3 O for(int i=0;i<6;i++). z7 C, S1 {2 ~4 u$ G
{/ d1 t6 j; M+ j( W9 P# ~ Z1 _8 c6 v
//System.out.println("第"+(i+1)+"個號碼"+r[i]);
! ~5 d' T# R! y" L" d System.out.printf("第%d個號碼:%02d",i+1,r[i]);
* E$ y; l6 ~; g$ Z- U5 E }$ V0 J# J' D% a
//System.out.println("特別號:"+r[6]);, U1 |: C: \: J) A
System.out.printf("特別號:%02d\n",r[6]);
3 K$ A; w4 a+ ^. O+ M }# s% x" ]" J3 e0 w/ y: z! L
* H+ f$ e3 Z1 C8 }( a9 F
} |