import java.util.ArrayList;import java.util.Collections;import java.util.Random; public class Choujiang { public ArrayList <Integer> Sumber; public static void main(String[] args) { Choujiang g = new Choujiang(); g.deal(); g.display(); // TODO Auto-
import java.util.ArrayList;import java.util.Collections;import java.util.Random; public class choujiang { private ArrayList<Integer> list; public void deal(){ //向list容器中添加指定数量num的整数 if (list == null){ list = new ArrayList<Integer>(); for(int i
import java.util.ArrayList; import java.util.Collections; import java.util.Random; public class Draw { private ArrayList<Integer>list; public Draw(){ list = new ArrayList<Integer>(); } public void deal(int num){ //向容器中添加奖券(使用循环) for (int i=0;i
先奉上最简单的抽奖代码... package Choujiang; public class Choujiang { public static void main(String[]args){ int[]a = new int[3]; String [] person ={"张三","李四","王二","李逵","小明"}; for(int i=0;i<3;i++){ a[i]=(int)(Math