int [,] a=new int[5,5];
Console.WriteLine("请输入1号的语文成绩:");
a[0, 1] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入1号的数学成绩:");
a[0, 2] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入1号的英语成绩:");
a[0, 3] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入2号的语文成绩:");
a[1, 1] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入2号的数学成绩:");
a[1, 2] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入2号的英语成绩:");
a[1, 3] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入3号的语文成绩:");
a[2, 1] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入3号的数学成绩:");
a[2, 2] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入3号的英语成绩:");
a[2,3] =Convert.ToInt32( Console.ReadLine());
Console.WriteLine("请输入4号的语文成绩:");
a[3,1] =Convert.ToInt32( Console.ReadLine());
Console.WriteLine("请输入4号的数学成绩:");
a[3,2] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入4号的英语成绩:");
a[3,3] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入5号的语文成绩:");
a[4,1] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入5号的数学成绩:");
a[4,2] =Convert.ToInt32( Console.ReadLine());
Console.WriteLine("请输入5号的英语成绩:");
a[4,3] =Convert.ToInt32( Console.ReadLine());
a[0,0]=1;
a[1,0]=2;
a[2,0]=3;
a[3,0]=4;
a[4,0]=5;
a[0,4]=(a[0,1]+a[0,2]+a[0,3]);
a[1,4]=(a[1,1]+a[1,2]+a[1,3]);
a[2,4]=(a[2,1]+a[2,2]+a[2,3]);
a[3,4]=(a[3,1]+a[3,2]+a[3,3]);
a[4,4]=(a[4,1]+a[4,2]+a[4,3]);
Console.Clear();
Console.WriteLine("学号\t语文\t数学\t英语\t总分");
for (int i=0;i <5;i++ )
{
for (int j=0; j<5; j++)
{
Console.Write(a[i,j]+"\t");
}
Console.Write("\n");
}
Console.Write("平均\t{0}\t{1}\t{2}\t{3}", (a[0, 1] + a[1, 1] + a[2, 1] + a[3, 1] + a[4, 1]) / 5, (a[0, 2] + a[1, 2] + a[2, 2] + a[3, 2] + a[4, 2]) / 5, (a[0, 3] + a[1, 3] + a[2, 3] + a[3, 3] + a[4, 3]) / 5, (a[0, 4] + a[1, 4] + a[2, 4] + a[3, 4] + a[4, 4]) / 5);