public void nums()
        {
            ArrayList list = new ArrayList();
            Random r = new Random();
            list.Add(r.Next(20));
            while (true) {
                if (list.Count == 20) break;
                int num = r.Next(1,21);
                if (list.Contains(num))
                {
                    continue;
                }
                else{
                    list.Add(num);
                }

            }
            foreach(int i in list)
            {
                Console.WriteLine(i);
            }
        }

 

posted on 2023-07-13 18:13  阿霖找BUG  阅读(14)  评论(0编辑  收藏  举报