Fork me on GitHub

使用二维数组求平均数

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

 

posted @ 2013-05-23 15:20  种花生的读书人  阅读(423)  评论(0编辑  收藏  举报

该博客仅作为记录笔记,转载随意