C#中运行时候出现报错,输入字符串的格式不正确。
while(true){Console.Clear();Console.WriteLine("\n简易客车售票系统\n");for(inti=0;i<9;i++){for...
while (true)
{
Console.Clear();
Console.WriteLine("\n 简易客车售票系统 \n");
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 4; j++)
{
System.Console.Write(roles[i,j]);
}
Console.WriteLine();
}
Console.WriteLine("请输入作为行号和列号(如0,2)输入q键退出:");
s = Console.ReadLine();
if (s == "q") break;
string[] ss = s.Split(',');
int one = int.Parse(ss[0]);
int two = int.Parse(ss[1]);
roles[one, two] = "【售出】"; 展开
{
Console.Clear();
Console.WriteLine("\n 简易客车售票系统 \n");
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 4; j++)
{
System.Console.Write(roles[i,j]);
}
Console.WriteLine();
}
Console.WriteLine("请输入作为行号和列号(如0,2)输入q键退出:");
s = Console.ReadLine();
if (s == "q") break;
string[] ss = s.Split(',');
int one = int.Parse(ss[0]);
int two = int.Parse(ss[1]);
roles[one, two] = "【售出】"; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询