为啥能够运行,却结果不对
#include<stdio.h>#define N 3
#define M 4
float score[M][N];
float class[M],people[N];
int main()
{
int i,j;
float h;
void input(void);
void aver1(void);
void aver2(void);
input();
aver1();
aver2();
printf("\nNO. cour1 cour2 cour3 cour4 aver\n");
for(i=0;i<N;i++)
{
printf("NO%2d",i+1001);
for(j=0;j<M;j++)
printf("%8.2f",score[i][j]);
printf("%8.2f\n",people[i]);
}
printf("\naverage:");
for(j=0;j<M;j++)
printf("%8.2f",class[j]);
printf("\n");
return 0;
}
void input(void)
{
int i,j;
for(i=0;i<N;i++)
{
printf("\nthe score of student %2d:",i+1001);
for(j=0;j<M;j++)
scanf("%f",&score[N][M]);
}
}
void aver1(void)
{
int i,j;
int s;
for(i=0;i<N;i++)
{
for(j=0;j<M;j++)
s+=score[i][j];
people[i]=s/(float)M;
}
}
void aver2(void)
{
int i,j;
int s;
for(j=0;j<M;j++)
{
for(i=0;i<N;i++)
s+=score[i][j];
class[j]=s/(float)N;
}
}