已经修改好了,请仔细对比(输入的每一个字符串内部不能包含空格):
#include
struct Student
{
int num;
char name[20];
char sex;
char addr[20];
}student;
main()
{struct Student student1;
scanf("%d %s %c %s",&student1.num,&student1.name,&student1.sex,&student1.addr);
printf("%d %s %c %s",student1.num,student1.name,student1.sex,student1.addr);
}
struct Student
{
int num;
char name[20];
char sex;
char addr[20];
};student;
改成
struct Student
{
int num;
char name[20];
char sex;
char addr[20];
} student;
?