好的,正如标题所说,我需要帮助找到一种将两个数组相加的简单方法。到目前为止,这是我的代码:
static void Main()
{
Console.Write("Enter Rows: ");
int row = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter Columns: ");
int col = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[row, col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
Console.Write("Enter Matrix({0},{1}): ", i, j);
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
int[,] b = new int[row, col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
Console.Write("Enter Matrix({0},{1}): ", i, j);
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
那么,我如何将这两个数组加在一起,并打印出结果。谢谢。