程序结果为什么是这样?
#include <stdio.h>#include <stdlib.h>
struct stu_Message
{
long num;
char name[100];
float score[3];
}stu[5];
int main(int argc, char *argv[])
{
void print (struct stu_Message *p1);
struct stu_Message *q =stu;
int i;
for (i = 0;i < 5; i++,q++)
{
printf ("请输入第%d个学生的信息\n",i + 1);
scanf ("%ld,%s,%f,%f,%f",&q->num,q->name,&q->score[i],&q->score[i+1],&q->score[i+2]);
}
q =stu;
print (q);
system("PAUSE");
return 0;
}
/*打印*/
void print (struct stu_Message *r)
{
int i;
for (i = 0;i < 5; i++,++r)
printf ("第%d个学生的信息为:%ld,%s,%f,%f,%f\n",i + 1,r->num,r->name,r->score[i],r->score[i+1],r->score[i+2]);
}
为什么每个学生的成绩后面多 几个000000000