1. 程式人生 > >求平均成績使用二維數組(網上找的,僅自用,非原創)

求平均成績使用二維數組(網上找的,僅自用,非原創)

student sys read his += class a oid new stat

using System;
class AverageofScore
{
public static void Main()
{
int[,] student_score=new int [4,5];
int temp;
for(int i=0;i<=3;i++)
{
temp=0;
for(int j=0;j<=4;j++)
{
Console.WriteLine ("請輸入第{0}個學生的第{1}門功課:",i+1,j+1);
student_score[i,j]=int.Parse (Console.ReadLine ());
temp+=student_score[i,j];
}
Console.WriteLine ("This student‘s average of score is"+temp/5);
}
}
}

求平均成績使用二維數組(網上找的,僅自用,非原創)