3月13日 抽奖活动

 //输入n个手机号,滚动号码,5秒后停止,做抽奖活动;
            Console.Write("输入手机号的个数");
            int a = int.Parse(Console.ReadLine());

            string[] shoujihao = new string[a];
            for (int i = 0; i < a; i++)
            {
                Console.Write("输入第" + (i + 1) + "个手机号码:");
                shoujihao[i] = Console.ReadLine();
            }
            Console.WriteLine("所有号码输入完毕,请按回车键滚动");
            Console.ReadLine();
            Random ran = new Random();

            for (int i = 0; i > -1; i++)
            {
                int aa = ran.Next(a);
                Console.Clear();
                Console.WriteLine(shoujihao[aa]);
                System.Threading.Thread.Sleep(100);
                if (i == 50)
                {
                    //Console.Clear();

                    //Console.WriteLine("123");

                    break;
                }

            }

            Console.ReadLine();

 

posted @ 2016-03-13 16:28  D董小姐  阅读(119)  评论(0编辑  收藏  举报