int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) { //输入的是0 0就结束 if(a==0 && b==0) break; ...//这里是输入不是结束数据的处理 } }
1 2 3 4 0 0
3 7