php做点名系统怎么做,做了个简单点名器

我们的老龚天天秀他的点名器,今天讲了个随机1-100数,想到可以做点名器,试了一下,果然成功了.代码如下://java点名器

class CallName {

public static void main(String[] args) {

String[] s ={"邓能维","江可","刘奎","赵嘉荣","陆慧","聂冲","宋文超","何跃","周庆",

"张晨","黎显兆","张军","周迪","鞠永强","曾丰","曾华","陈泉元","邓凯宾",

"黄贵良","刘泽浩","杨明灿","张伟强","钟沅锋","田明","徐东阳","董方杰",

"阮伟科","林金兴","刘学勇","梁琦伟","刘智勇","李华","林伟文","陈星",

"苏永亮","杨乐","徐斌","宋瑶","王楚贵","郭喜平","文新星","郑舒欣","曹德华",

"陈家文","张灿耿","程林","范秋宁","范宇健","李贤智","陈沛明","李杰","唐昭亮",

"官左","陈舒挺","陈海乾","翁泽钿","于欣智","贾泽宇","王佳","黄鹏飞","林兴才",

"林兴煌","陈小林","谢灿","廖秋林","张宁","刘鹏","苏培源","宁文强","邓立","叶发伟",

"龙水文","陈灿","彭倩","徐彤","许涛","潘丽","龚奎","唐耀玮","袁峰","陈杰","罗志辉"};

while(true) {

int number = (int)(Math.random()*100);

if (number>82)

System.out.println("不是吧,这么被,再来一次吧");

}else {

System.out.println(s[number]);

break;

}

}

班上本有86人,但是少输了几个名字,数了一下有82人,索引为81.测试过,没有问题.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值