作业帮 > 综合 > 作业

ACM水题求解Input contains multiple test cases.Each test case con

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/09/20 13:32:57
ACM水题求解
Input contains multiple test cases.Each test case contains a pair of integers a and b,one pair of integers per line.A test case containing 0 0 terminates the input and this test case is not to be processed.For each pair of input integers a and b you should output the sum of a and b in one line,and with one line of output for each line in input.
我的代码
#include
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)
if(a!=0&&b!=0)
coutb&&(a||b))
coutb&&(a||b))
cout
ACM水题求解Input contains multiple test cases.Each test case con
题目要求是a跟b都是0的时候输入结束而且这组数据不用处理,你那个是当全不等于0时才输出答案,但是漏掉了其中一个为0的情况.亲.while没有大括号,你那个else之后的continue是要到哪里去.你把那里换成break还可以吧.现在的百度都不愿意有人帮别人回答问题还是怎么的,我问的就没有人来答.