#include<stdio.h>
int main()
{
int i,j,x=0,y=0,max;
int a[3][5];
float ave1,ave2,fc;
for(i=0;i<3;i++)
{
printf("please enter the %d student grade:",i+1);
for(j=0;j<5;j++)
scanf("%d",&a[i][j]);
}
for(i=0;i<3;i++)
{
for(j=0;j<5;j++)
{
x=x+a[i][j];
}
ave1=x/5.00;
printf("the %d student average grade:%.2f\n",i+1,ave1);
x=0;
}
for(j=0;j<5;j++)
{
for(i=0;i<3;j++)
{
y=y+a[i][j];
}
ave2=y/3.00;
printf("the %d subject average grade:%.2f\n",j+1,ave2);
y=0;
}
}
成绩
最新推荐文章于 2022-06-20 08:00:00 发布