while读入方法
1.scanf("%d", &x) != EOFwhile(scanf("%d", &x) != EOF)2.~scanf("%d", &x)while(~scanf("%d", &x))例:#include <bits/stdc++.h>using namespace std;int x;int main(){ while(~scanf("%d", &x) && x != 42) { printf("%d\
原创
2020-08-25 14:38:29 ·
220 阅读 ·
0 评论