用scanf不输入时,自动停止的方法

while(scanf("%d",&s)!=EOF){...}

这里,当没有继续输入后,就会因为等于EOF而自动停止

猜你喜欢

转载自blog.csdn.net/hgtjcxy/article/details/81281587