package xq;
import java.util.ArrayList;
import java.util.Collections; import java.util.Random;public class choujiang {
ArrayList cards;public ArrayListdeal(){ if(cards==null){ cards = new ArrayList (); for(int i =1;i<100;i++){ cards.add(i); } } Collections.shuffle(cards); return cards;}public void play(){ Random r = new Random(); int a = r.nextInt(100); System.out.println("一等奖:"+ cards.get(a)+"号"); cards.remove(a); for(int i=1;i<=3;i++){ a = r.nextInt(100); System.out.println("二等奖:"+cards.get(a)+"号"); cards.remove(a); }}public static void main(String[] args) {choujiang a=new choujiang();a.deal();a.play();}