[求助]找错:3*3的矩阵对角边的和
//3*3的矩阵对角边的和
using System;
class class1
{
static void Main(string[] args)
{
int[,] a = new int[3, 3];
int zuo = 0;
int you = 0;
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 3; j++)
{
Console.Write("请输入第{0}行第{1}列的值:", i, j);
a[i, j] = int.Parse(Console.ReadLine());
}
}
for(int i = 0, int j = 2; i < 3, j >= 0; i++, j--)
{
zuo += a[i, j];
}
for(int i = 0; i < 3; i++)
{
you += a[i, i];
}
Console.WriteLine("zuo ={0}\tyou={1}", zuo, you);
}
}