要求: 输入对应个数的手机号码或者数字, 完成随机抽奖;
随机抽奖这一段没有实现按键暂停显示结果,console端可以实现吗; <代码参考了网络版本>
Console.Write("please input cellphone numbers:");
int a = int.Parse(Console.ReadLine());
string[] sj = new string[a];
for (int i = 0; i < a; i++)
{
Console.Write("please input the" + " " + (i + 1) + " " + "cellphone number:");
sj[i] = Console.ReadLine();
}
foreach(string aaa in sj)
{
Console.WriteLine(aaa);
}
Console.WriteLine("The Above are the stored" + " " + a + " " + "cellphone numbers");
//Console.WriteLine("{0} + {1} + {2}", sj[0],sj[1],sj[2]);
Console.WriteLine("input finish,press enter to start lucky draw!Press Enter again to stop");
Console.ReadLine();
Random ran = new Random();
int r = 0;
for (; ; )

这篇博客介绍了如何使用C#编写一个基于控制台的抽奖程序,用户输入指定数量的手机号或数字进行抽奖。文章探讨了如何实现随机数生成,并提到虽然未实现按键暂停显示结果的功能,但讨论了在console环境下实现的可能性。
最低0.47元/天 解锁文章
12万+

被折叠的 条评论
为什么被折叠?



