能正确的输入输出,为什么输出老是出现烫烫烫烫
#include<stdio.h>#define CS 3
struct name{
char m[20];
char xi[20];
};
struct student{
struct name stu;
int grade[3];
double average;
};
int main()
{
int i,j;
double yuwen,math,Eng;
struct student people[CS];
printf("please input name:\n");
for(i=0;i<4;i++)
{
scanf("%s-%s",&people[i].stu.m,&people[i].stu.xi);
}
printf("please input score:\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
scanf("%d",&people[i].grade[j]);
}
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
people[i].average+=people[i].grade[j]/3.0;
yuwen=people[j].grade[0]/3.0;
math=people[j].grade[1]/3.0;
Eng=people[j].grade[2]/3.0;
}
for(i=0;i<3;i++)
{
printf("%s%s",people[i].stu.m,people[i].stu.xi);//就是这段打印语句和下面的打印语句有问题,但我又找不出有什么问题,请各位大虾帮忙看下,小弟感激不尽
for(j=0;j<3;j++)
printf("%d\t%lf",people[i].grade[j],people[i].average);
}
printf("%lf\t%lf\t%lf",yuwen,math,Eng);
return 0;
}