background image

}

while(strlen(p1->EngineerName) == 0 || strlen(p1->EngineerName) > 20)
{

printf("工程师姓名输入错误,请重新输入:");
scanf("%s",p1->EngineerName);

}

while (p1->EngineerSex != 0 && p1->EngineerSex != 1)
{

printf("工程师性别输入错误,请重新输入:\n");
scanf("%d",&p1->EngineerSex);

}

while (p1->EngineerBirth.year<1900 || p1->EngineerBirth.year > 2004)
{

printf("工程师生日中的年输入错误,请重新输入:\n");
scanf("%d",&p1->EngineerBirth.year);

}

while (p1->EngineerBirth.month < 1 || p1->EngineerBirth.month > 12)
{

printf("工程师生日中的月输入错误,请重新输入:\n");
scanf("%d",&p1->EngineerBirth.month);

}

while (p1->EngineerBirth.day < 1 || p1->EngineerBirth.day > 31)
{

printf("工程师生日中的日输入错误,请重新输入:\n");
scanf("%d",&p1->EngineerBirth.day);

}

while (p1->EngineerEducation < 0 || p1->EngineerEducation > 4)
{

printf("工程师的学历输入错误,请重新输入:\n");
scanf("%d",&p1->EngineerEducation);

}

while(strlen(p1->EngineerHometown) == 0 || strlen(p1->EngineerHometown) > 10)
{

printf("工程师的籍贯输入错误,请重新输入:\n");
scanf("%s",p1->EngineerHometown);

}