int c; while((c = getchar()) != ‘\n‘ && c != EOF);
c刷新缓冲区
原文:http://www.cnblogs.com/xiaopipi/p/6728805.html