当我运行下面的代码片段时,它会运行到第二个问题。然后它将“客户是学生吗?(y/n)\ n”和“什么是电影时间?(以小时为单位)\ n”一起提示(没有区域来回答他们之间的问题)。如果从那里采取任何行动,程序将停止工作。我做错了什么? (我敢肯定它的语法关系)使用C scanf语法的帮助
int A,B,C,D,age,time;
char edu, ddd;
printf ("What is the customer's age? \n");
scanf("%d", &age);
printf ("Is the customer a student? (y/n) \n");
scanf("%c", &edu);
printf ("What is the movies time? (in hours) \n");
scanf("%d", &time);
printf ("Is the movie 3-D? (y/n) \n");
scanf("%c", &ddd);
[This](http://stackoverflow.com/questions/1669821/scanf-skips-every-other-while-loop-in-c)可能会有所帮助。 – sje397 2010-09-16 04:45:29
最好避免使用'scanf':http://c-faq.com/stdio/scanfprobs.html – jamesdlin 2010-09-16 05:52:44