输入的判断

while (scanf("%d", &n) != EOF)

原文地址:https://www.cnblogs.com/darlingroot/p/10310942.html