实全软件科技有限公司

衡斅-衡量使人觉悟

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2011年6月16日

摘要: 为了尽快完成面试,第一反应就是想到先创建数组,然后随机产生1-100的数字,再与数组进行比较,数组中没有此数字时进行比较,虽然这种方法不好,但能够实现功能。示例代码如下:static void Main(string[] args){int[] num = new int[100];List<int> temp = new List<int>();Random rand = new Random();int number = 0;for (int index = 0; index < num.Length; index++){ do { //随机产生1-100的数 阅读全文
posted @ 2011-06-16 20:28 衡斅 阅读(1389) 评论(8) 推荐(0)