public class Choujiang {
Private arraylist<integer> cards;
public void deal (int num) {
if (cards==null) {
Cards=new arraylist<integer> ();
for (num=1;num<=100;num++) {
Cards.add (num);
}
}
Collections.shuffle (cards);
}
public void Draw () {
Random ra=new random ();
int s =ra.nextint (cards.size ());
System.out.println ("First prize:" + Cards.get (s));
Cards.remove (Cards.get (s));
Collections.shuffle (cards);
for (int i=0;i<2;i++) {
int Stwo=ra.nextint (cards.size ());
System.out.println ("Second Prize:" + Cards.get (stwo));
Cards.remove (Cards.get (stwo));
}
Collections.shuffle (cards);
for (int J =0;j<3;j++) {
int SThree =ra.nextint (cards.size ());
System.out.println ("Third Prize:" +cards.get (SThree));
Cards.remove (Cards.get (SThree));
}
}
public static void Main (string[] args) {
TODO auto-generated Method Stub
Choujiang C = new Choujiang ();
C.deal (0);
C.draw ();
}
}
Java Sixth time job