3.采用多种算法,模拟摇奖:从1-36中随机抽出8个不重复的数字
int[] shuzu=new int[8];
Random ran=new Random();
for(int i=0;i<shuzu.length;i++)
{
shuzu[i]=ran.nextInt(36);
for(int j=0;j<i;j++)
{
if(shuzu[i]==shuzu[j])
{
i--;
}
} }
for(int i=0;i<shuzu.length;i++)
{System.out.println(shuzu[i]);}

  

最新文章

  1. [python]set集合学习
  2. ifconfig: command not found 如何解决?
  3. ABP理论学习之实体类
  4. js代码生成form,解决mvc的url参数过长问题
  5. Linux CentOS6.8下解压安装mysql-5.7.14完整介绍
  6. Linux踢出其他正在SSH登陆用户
  7. hdu 2583 permutation
  8. POJ1201 Intervals(差分约束系统)
  9. 使用pch预编译文件
  10. linux源代码阅读笔记 linux文件系统(转)
  11. Celery Flower监控,完美搞定
  12. Springmvc整合mybatis
  13. find the safest road--hdu1596
  14. ORA-20000: ORU-10027: buffer overflow, limit of 10000 bytes
  15. Get RSA public key ASN.1 encode from a certificate in DER format
  16. JavaScript八张思维导图—编程实践
  17. [ 10.4 ]CF每日一题系列—— 486C
  18. If you did this already, delete the swap file &quot;.git/.MERGE_MSG.swp&quot;
  19. What is SolrCloud? (And how does it compare to master-slave?)
  20. ASP.NET MVC 习惯

热门文章

  1. ubuntu安装goldendict以及添加本地词典和在线词典
  2. set命令
  3. 解决Android SDK Manager更新、下载速度慢
  4. Java猜拳小游戏(剪刀、石头、布)
  5. Python 6 —— 异常
  6. [c语言]字符数组、字符串定义
  7. (最小路径覆盖) News 消息传递 (hust OJ 2604)
  8. 首次创建maven项目的准备工作
  9. iOS开发零基础--Swift篇 元组
  10. java和android及IOS对接RSA加密经验