当我调试程序启动时没有语法错误我选择新学生并告诉我学生ID我把它然后程序转到姓氏而不让我写第一个名字和这个截图[http://www.mediafire.com/view/f2m3kcdx2xv0fdp/Capture.PNG]
#include <stdio.h>
#include <stdlib.h>
struct StudentRecord{
int id;
char fname[15];
char lname[15];
struct studentaddres
{
char city[15],street[15],number[15];
}addres[2];
}student[2];
int main()
{
printf("1:Enter New Student\n2:Remove Student\n3:Search\n4:Sort\n5:Exit\n");
int x,i;
scanf("%d",&x);
switch(x)
{
case 1:
{
for(i=0;i<2;i++)
{
printf("\nEnter Student %d Id:",i+1);
scanf("%d",&student[i].id);
printf("\nEnter Student %d First name:",i+1);
gets(student[i].fname);
printf("\nEnter Student %d Last name:",i+1);
gets(student[i].lname);
printf("\nEnter Student %d City:",i+1);
gets(student[i].addres[i].city);
printf("\nEnter Student %d Street:",i+1);
gets(student[i].addres[i].street);
printf("\nEnter Student %d Street Number:",i+1);
gets(student[i].addres[i].number);
}
break;
}
}
}