求平均成绩使用二维数组(网上找的,仅自用,非原创)

时间:2018-04-07 15:43:05   收藏:0   阅读:197

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);
}
}
}

原文:https://www.cnblogs.com/hsyv123ve/p/8733309.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!