public class java1224 {2 l6 ?0 K+ b4 ?7 l1 p: q- S
9 B% |: T" a n$ J public void main(String[]arg){5 C- ~! Z, ^, k: `9 V! @3 ?' A
int r[]=new int[42];, ?. R, ~: H: w; H: v; f
for(int i=0;i<42;i++)/ I6 `- ]' t( N
{
9 ]+ {, |- \' F r[i]=i+1;
4 B" @% r' ]% r' v2 R$ U5 J R }
' [+ F4 w) `6 T, I m+ [7 P for(int i=0;i<42;i++)
6 \8 L* _% x4 u# a" ^! ? {
6 b4 W$ s1 i. A% r/ |- |) C int rr=(int)(Math.random()*42);
( G: G9 M8 w0 G: }2 l5 t int t=r[i];+ X( o& ~# k7 w, s. T6 o' o
r[i]=r[rr];
Q* f# e- m8 D0 r" ?$ A5 }$ |/ H, J r[rr]=t;
7 E0 K4 B. l8 J% G( q' ?2 j2 j+ o }
k9 S9 t! f! B% R# N" k for(int i=0;i<6;i++)
$ M% l: `1 Y! A, c5 i$ @* o {/ k, k! W( d, g8 Z/ k6 y
//System.out.println("第"+(i+1)+"個號碼"+r[i]);4 @2 }2 c6 h" e
System.out.printf("第%d個號碼:%02d",i+1,r[i]);3 _4 T% K4 l- G, u7 P
}
: a8 m: a W7 C9 Y2 W* h //System.out.println("特別號:"+r[6]);
- b. F% n9 C+ f* v$ z: } System.out.printf("特別號:%02d\n",r[6]); 6 Z% a# P9 K( Q) \0 N6 L
}. C* ^) v+ p0 e: y3 ]
. T% R3 \: w% {8 j1 ]( m} |