public void PrintNames()
{
string[,] matrix = new string[3, 3];
Console.WriteLine("write a name:");
string a = Console.ReadLine();
Console.WriteLine("write a name:");
string b = Console.ReadLine();
for (int i = 0; i < 3; i++)
{
for (int x = 0; x < 3; x++)
{
Console.Write("{0} row {1} component {2} name", i +1,x+1, matrix[i, x]);
Console.WriteLine();
}
}
}
我是一位真正的初学者程序员,我想完成我的作业。 我的问题是我无法打印在控制台中写的名称。例如:请写一个名字:Jhon Wick(输入) 请输入名称:Kyle(输入) 之后,我要打印:1.行1.组件Jhon Wick 1.行2.组件Kyle