public class java1224 {
9 ~ l+ P" G# W# D5 k" W5 o6 U, U6 I. |3 I& L g
public void main(String[]arg){
3 h% \& p7 a% u1 ^9 g int r[]=new int[42];, R/ y3 G2 b8 ~; ^4 y7 P
for(int i=0;i<42;i++)% ^- c4 w3 _- F. B
{) p) X' b2 q; }) z w! L
r[i]=i+1;
' E) G2 S+ b# j% N& p% G! Y p1 \ }
( w+ x8 }5 j; N& V for(int i=0;i<42;i++)
$ g; [6 z5 T' L( u5 |/ r4 d {- E8 R e+ q( }- P+ S
int rr=(int)(Math.random()*42);/ s! ~# N: o2 g( k- y
int t=r[i];5 M( c3 F6 `% F2 { ]. \2 J8 b
r[i]=r[rr];- Z( I7 a# _* D; l- V
r[rr]=t;0 `8 l( d& y0 i/ _
}
5 y0 V9 s: i$ m) Y for(int i=0;i<6;i++)
4 G* S0 R6 P, K& L! g5 i9 M1 c8 ^3 m {; g# f+ p2 Y- U! x) @8 e$ e
//System.out.println("第"+(i+1)+"個號碼"+r[i]);7 h" _6 r. A* E+ i4 \; h
System.out.printf("第%d個號碼:%02d",i+1,r[i]);
& d1 ]1 O E0 V( P2 g$ n; U8 A }
+ V& Y, U9 U& x9 N( I //System.out.println("特別號:"+r[6]);
: n4 |- |1 j/ \) @4 W. X. [) R0 m System.out.printf("特別號:%02d\n",r[6]);
- O; j) n$ B4 G7 Y' A; Z, @5 R }0 ]: g- a& b2 v5 Q, m/ S6 f; ^
( { h( O$ y* x
} |