public class j102
3 a6 R9 V* X& J4 ^{. i* E. _7 F% _$ K3 @$ x6 \7 Y. G W
public static void main(String arg[])3 c+ L; }5 K Y4 g/ g! }
{
* ]& [. Z3 t" T$ ?1 s. R' N* | int num []={1,2,3,4,5,6,7,8,9};- i6 c- o1 P4 M+ R* D
while(trun)# X. O, I7 L( u% V; R# J$ f
{5 D( h4 V1 `- G3 j6 U
int r=(int)(Math.random()*9)+1;
# [) ]$ B8 v2 h( u: r int t=num[i];
; f: G# N4 x: I f& y* q2 b' j num[i]=num[r];1 q, D- j1 {1 B3 ^
num[r]=t;+ j7 n5 L- t. G
int a1 = num[0] + num[1] + num[2] ;
# ~0 B. z& |+ ^8 | int a2 = num[3] + num[4] + num[5] ;* [+ y' \1 h2 b. I5 l0 s9 d$ I
int a3 = num[6] + num[7] + num[8] ;4 h | P3 p! S0 r# `' E
int a4 = num[0] + num[3] + num[6] ;! C/ l d1 z) p) i
int a5 = num[1] + num[4] + num[7] ;
) M! @' o& b/ @0 H9 ` int a6 = num[2] + num[5] + num[8] ;+ r' ?. q- j8 R! N* n% G: h! x
int a7 = num[0] + num[4] + num[8] ;
7 y, h& [, \: B+ W9 ` int a8 = num[2] + num[4] + num[6] ; F. x, e7 u' U) t( k
if(a1==15&&a2==15&&a3==15&&a4==15&&a5==15&&a6==15&&a7==15&&a8==15)5 G4 i3 c$ O7 _. J% V! Z; q
}break; " \4 O! S, i3 ]6 D+ m3 }. u& W8 O* O
}$ Y: m& E% p( ~! Z7 y
} |