C语言,求解释
#include <stdio.h>#include <stdlib.h>
struct Student
{
int num;
char name[10];
float score[3];
}stu[3];
int main()
{
void print(struct Student stud[]);
int i;
printf("请输入三名学生的学号,姓名,三个科目的成绩:\n");
for(i=0;i<3;i++)
scanf("%d,%s,%f,%f,%f",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
print(stu);
return 0;
}
void print(struct Student stud[])
{
int i;
printf("请输出三名学生的的学号,姓名,三个科目的成绩:\n");
for(i=0;i<3;i++)
printf("%d,%s,%f,%f,%f\n",stud[i].num,stud[i].name,stud[i].score[0],stud[i].score[1],stud[i].score[2]);
}
请输入三名学生的学号,姓名,三个科目的成绩:
1120,aaa,12,12,12
1130,bbb,13,13,13
1140,ccc,14,14,14
请输出三名学生的的学号,姓名,三个科目的成绩:
1120,aaa,12,12,12,0.000000,0.000000,0.000000
1130,bbb,13,13,13,0.000000,0.000000,0.000000
1140,ccc,14,14,14,0.000000,0.000000,0.000000\
请问下后面的0.000000,0.000000,0.000000是怎么来的?则呢么把它们给去掉呀??