c#数组,手机号随机数抽奖
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _20
{
class Program
{
static void Main(string[] args)
{
//20.输入手机号码个数,根据手机号码个数创建数组。做抽奖活动。
Console.Write("请输入手机号码个数:");
int a = int.Parse(Console.ReadLine());
string [] shuzu = new string [a];
for (int i = 0; i <a; i++)
{
Console.Write("请输入第" + (i + 1) + "个手机号:");
shuzu [i] = Console.ReadLine();
}
Console.WriteLine("所有手机号码已经输入完成,3秒后开始抽奖");
System.Threading.Thread.Sleep(3000);
Console.Clear();
for (int i = 0; i >= 0;i++ )
{
Random ran = new Random();
int q = ran.Next(a);
Console.WriteLine(shuzu[q]);
System.Threading.Thread.Sleep(10);
Console.Clear();
}
Console.ReadLine();
}
}
}