输入n个手机号,做抽奖活动
Console.Write("请输入手机号的个数:"); int n = int.Parse(Console.ReadLine()); string []hao=new string[n]; for (int i = 0; i < hao.Length;i++ ) { Console.Write("请输入第"+(i+1)+"个手机号码:"); hao[i]=Console.ReadLine(); } Console.WriteLine("所有的号码输入完毕,请按回车键进行号码滚动!"); Console.ReadLine(); Random ran = new Random(); for (int i = 0; i < 50;i++ ) { Console.Clear();//清屏 int suiji = ran.Next(hao.Length); Console.Write("中奖号码是:"+hao[suiji]); //等待,暂停100毫秒 System.Threading.Thread.Sleep(100); } //作弊代码 //Console.Clear(); //Console.Write("中奖号码:110"); Console.ReadLine();