首页 > 其他 > 详细

3月13日 抽奖活动

时间:2016-03-13 17:48:32      阅读:94      评论:0      收藏:0      [点我收藏+]
 //输入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();

 

3月13日 抽奖活动

原文:http://www.cnblogs.com/dongqiaozhi/p/5272325.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!