在c语言中,经常会有在标准输入多次输入。
用scanf()、gets()等多次使用标准输入时,注意非法字符影响下次输入。解决方法:
char c;
while((c=getchar())!='\n')
continue;