package exhaust;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.nio.channels.ShutdownChannelGroupException;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class ExhaustText {
static ArrayList<Integer> List;
public ArrayList<Integer> deal(){
if(List == null){
List = new ArrayList<Integer>();
for(int i=1;i<350;i++){
List.add(i);
}
}
Collections.shuffle(List);
return List;
}
public void display(){
String [] player = {"张三","李四","王五"};
for(int i=0;i<3;i++){
System.out.print(player[i]+"抽取的号码为:");
for(int j=i;j<i+1;j++){
System.out.println(List.get(j)+"号");
List.remove(j);
}
System.out.println();
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ExhaustText eh = new ExhaustText();
eh.deal();
eh.display();
}
}