最后的输出要输出2个空格
#include<stdio.h>
#include<string.h>
void main()
{
double ave[6]={0.0};
int i,j,n,m,num,sum,flag;
int grade[52][6];
while(scanf("%d%d",&n,&m)!=EOF)
{
num=0;
memset(ave,0,sizeof(ave));
memset(grade[51],0,sizeof(grade[51]));
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
scanf("%d",&grade[i][j]);
ave[j]+=grade[i][j]*1.0;
}
}
for(i=1;i<=m;i++)
ave[i]=ave[i]*1.0/n;
for(i=1;i<=n;i++)
{
sum=0;
flag=1;
for(j=1;j<=m;j++)
{
sum+=grade[i][j];
if(grade[i][j]<ave[j])
flag=0;
}
if(flag==1)
++num;
if(i==1)
printf("%0.2lf",sum*1.0/m);
else
printf(" %0.2lf",sum*1.0/m);
}
printf("\n");
for(i=1;i<=m;i++)
if(i==1)
printf("%0.2lf",ave[i]);
else
printf(" %0.2lf",ave[i]);
printf("\n%d\n\n",num);
}
}