while(cin)退出循环的解决方案

int a;

while(cin>>a){

if(getchar()=='\n') break;

}

posted @ 2021-11-18 14:28  tisug  阅读(133)  评论(0)    收藏  举报