码迷,mamicode.com
首页 > 其他好文 > 详细

集合ArrayList双色球练一练(自己的方法,太麻烦)

时间:2015-04-08 23:05:25      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

namespace 集合__双色球练一练
{
    class Program
    {
        static void Main(string[] args)
        {
        //    while (true)
        //    {
               
        //     ArrayList al = new ArrayList();
        //    al.Add(1); al.Add(2); al.Add(3); al.Add(4); al.Add(5); al.Add(6); al.Add(7); al.Add(8); al.Add(9); al.Add(10); al.Add(11); al.Add(12); al.Add(13); al.Add(14); al.Add(15); al.Add(16); al.Add(17); al.Add(18); al.Add(19); al.Add(20); al.Add(21); al.Add(22); al.Add(23); al.Add(24); al.Add(25); al.Add(26); al.Add(27); al.Add(28); al.Add(29); al.Add(30); al.Add(31); al.Add(31); al.Add(31);
        //    Random r = new Random();
        //    int x = r.Next(1,al.Count);
        //    Console.Write(x+"\t");
        //    al.Remove(x);
        //    int y = r.Next(1, al.Count);
        //    Console.Write(y + "\t");
        //    al.Remove(y);
        //    int z = r.Next(1, al.Count);
        //    Console.Write(z + "\t");
        //    al.Remove(z);
        //    int s = r.Next(1, al.Count);
        //    Console.Write(s + "\t");
        //        al.Remove(s);
        //    int t = r.Next(1, al.Count);
        //    Console.Write(t + "\t");
        //    al.Remove(t);
        //    int w = r.Next(1, al.Count);
        //    Console.Write(w + "\t");
        //    al.Remove(w);
        //    //蓝球
        //    int q = r.Next(1, 17);
        //    Console.Write("蓝球为"+q + "\t");

        //    Console.ReadLine();
        //    }


            //Random r = new Random();
            //ArrayList al = new ArrayList();
            //while (true)
            //{
            //    if (al.Count == 6)
            //    {
            //        break;

            //    }
            //    else
            //    {
            //        int a = r.Next(1, 34);
            //        if (al.Contains(a))
            //        {

            //        }
            //        else
            //        {
            //            al.Add(a);
            //        }
            //    }
            //}
            //al.Sort();
            //Console.Write("红球为\t");
            //for (int i = 0; i < al.Count; i++)
            //{
            //    Console.Write(al[i] + "\t");
            //}
            //int y = r.Next(1, 17);
            //Console.Write("蓝球为" + y);
            //Console.ReadLine();
                    
        }
    }
}

集合ArrayList双色球练一练(自己的方法,太麻烦)

标签:

原文地址:http://www.cnblogs.com/lk-kk/p/4404091.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!