主要是判断停止的条件就可以了
#include<iostream>
using namespace std;
int main(){
int i,a,b;
while( scanf("%d %d",&a,&b)){
if(a!=0&&b!=0)
printf("%d\n",a+b);
else
break;
}
return 0;
}
#include<iostream>
using namespace std;
int main(){
int i,a,b;
while( scanf("%d %d",&a,&b)){
if(a!=0&&b!=0)
printf("%d\n",a+b);
else
break;
}
return 0;
}
相关推荐