为什么程序结果和实际不一样?简单程序
#include<stdio.h>#define TOTAL 5
void main()
{
int i,j,sum=0,k;
char a[TOTAL],b[TOTAL];
printf("The correct answer:\n");
for(i=0;i<TOTAL;i++)
scanf("%c",&a[i]);
printf("The answer of student:\n");
for(j=0;j<TOTAL;j++)
scanf("%c",&b[j]);
for(k=0;k<TOTAL;k++) if(a[k]==b[k]) sum++;
printf("The number of correct answers:%d\n",sum);
}