ZKX's LAB

Excel如何随机抽取数字? 随机抽取指令

2020-10-02知识3

如何在ppt中插入命令按钮,并具有随机抽取数字1-55的功能

Excel如何随机抽取数字? 随机抽取指令

随机抽取的代码 static public void ProgramProblem12(){List<;int>;intList=new List(6);Random rand=new Random();for(int i=0;i;i){for(int j=0;j;j){intList.Add(rand.Next(5));}}}intList中一次放着三个班随机抽到的学生的编号,这里默认每个班的学生的编号都是从0-5编号的

Excel如何随机抽取数字? 随机抽取指令

如何用EXCEL实现随机抽取?

Excel如何随机抽取数字? 随机抽取指令

Java随机抽取人名完整代码 public class test {public static void main(String[]args){定义人名数组String[]name={\"张三\",\"李四\",\"王五\",\"八神庵\",\"不知火舞\",\"大蛇\",\"景天\",\"唐雪见\",\"李逍遥\",\"赵灵儿\"};随机生成数组下标、int num=(int)(Math.random()*1000);对生成的随机数进行判断,如果小于数组下标,就跳出循环while(num>;name.length-1){if(num){break;}num=(int)(Math.random()*1000);}将数组下标设置成随机数,就可以实现人名的随机抽取System.out.println(“被抽到的同学是:”+name[num]);}}

#电子表格#随机数

随机阅读

qrcode
访问手机版