首页 > 编程语言 > 详细

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

时间:2018-04-07 15:43:05      阅读:197      评论:0      收藏:0      [点我收藏+]

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)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!