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


    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+" ");
            //    al.Remove(x);
            //    int y = r.Next(1, al.Count);
            //    Console.Write(y + " ");
            //    al.Remove(y);
            //    int z = r.Next(1, al.Count);
            //    Console.Write(z + " ");
            //    al.Remove(z);
            //    int s = r.Next(1, al.Count);
            //    Console.Write(s + " ");
            //        al.Remove(s);
            //    int t = r.Next(1, al.Count);
            //    Console.Write(t + " ");
            //    al.Remove(t);
            //    int w = r.Next(1, al.Count);
            //    Console.Write(w + " ");
            //    al.Remove(w);
            //    //蓝球
            //    int q = r.Next(1, 17);
            //    Console.Write("蓝球为"+q + " ");

            //    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("红球为 ");
                //for (int i = 0; i < al.Count; i++)
                //{
                //    Console.Write(al[i] + " ");
                //}
                //int y = r.Next(1, 17);
                //Console.Write("蓝球为" + y);
                //Console.ReadLine();
                        
            }
        }
    }

  • 相关阅读:
    关闭Pinterest通知
    android——创建camera应用(译)
    Android样式——Styles
    Android Fragment学习(一)
    Win32汇编环境配置
    关于微信检测SDK应用的原理浅析(iOS)
    iOS的Mantle实战
    Objective-C运行时的一些技巧
    Autolayout入门教程
    基于RAC的通用TableView
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4404091.html
Copyright © 2020-2023  润新知