有一个二维数组int[,] a= { {3,6,7},{5,7
2018-11-29 本文已影响0人
唯一的one
image.png
image.png
image.png
int[,] a = { { 3, 6, 7 }, { 5, 7, 1 }, { 9, 4, 2 } };
int sum = 0;
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(1); j++)
{
sum += a[i, j];
Console.Write(a[i, j] + "\t");
}
Console.Write(sum + "\t");
Console.WriteLine();
sum = 0;
}