这个程序有什么问题,为什么终止不了循环?
#include <stdio.h>char get_choice();
char get_first();
int main()
{
int ch;
printf("Enter the letter of your choice: \n");
printf("a. advice b. bell\n");
printf("c. count q. quit\n");
ch = get_first();
while((ch < 'a' || ch > 'c') && ch != 'q')
{
printf("Please respond with a, b, c, or q. \n");
ch = get_first();
}
return ch;
}
char get_first(void)
{
int ch;
ch = getchar();
while(getchar() != '\n')
continue;
return ch;
}