Console.WriteLine("輸入人數");
?string str_a = Console.ReadLine();
?try
{
?int a = Convert.ToInt32(str_a);
for (int i = 1; i <= a; i++)
?{
Console.WriteLine("輸入第{0}位用戶信息", i);
?Console.Write("輸入用戶編號(<4位整數>>:");
?string b = Console.ReadLine();
?Console.WriteLine("請輸入用戶年齡");
?string str_c = Console.ReadLine();
int c = Convert.ToInt32(str_c);
if (c > 10)
{
Console.WriteLine("請輸入用戶積分");
string d = Console.ReadLine();
Console.WriteLine("您輸入的信息是:");
?Console.WriteLine("用戶編號:{0}\t年齡:{1}\t積分{2}", b, c, d);
?}
else
?{
Console.WriteLine(@"很抱歉,您的年齡不適合該游戲 ,此用戶信息錄入失敗");
?}
}
}
catch
{
Console.WriteLine("輸入的用戶名不是數字");
?}
?Console.ReadKey();