怎么average输出的全是0;哪里出错了????
#include <stdio.h>#define a 3
#define people 3
int main(int argc, char *argv[])
{
int CHENGJI[a][3],sum[3];
float average[3];
int i,j;1
printf("请输入成绩:\n");
for(i=0;i<3;i++)
{
for(j=0;j<a;j++)
{
scanf("%d",&CHENGJI[j][i]);
}
}
for(i=0;i<3;i++)
{ sum[i]=0;
for(j=0;j<3;j++)
{
sum[i]=sum[i]+CHENGJI[j][i];
average[i]=sum[i]/3;
}
}
for(i=0;i<3;i++)
{printf("sum:%d\n average:%d\n",sum[i],average[i]);}
return 0;
}