在这个程序中第二次和第四次scanf都被跳过了,不知道是什么原因。有人可以告诉原因吗?
#include<stdio.h>
main()
{
int age;
char sex,status,city;
printf("Enter the persons age \n");
scanf("\n%d",&age);
printf("enter the gender\n");
scanf("%c",&sex);
printf("enter the health status");
scanf("%c",&status);
printf("where the person stay city or village");
scanf("%c",&city);
if(((age>25)&&(age<35))&&(sex=='m')&&(status=='g')&&(city=='c'))
printf("42");
else if(age>25&&age<35&&sex=='f'&&status=='g'&&city=='c')
printf("31");
else if(age>25&&age<35&&sex=='m'&&status=='b'&&city=='v')
printf("60");
else
printf("no");
}