一道ACM的入门题:A+B for Input-Output Practice1(入门)DescriptionYour task is to Calculate a + b.InputInput 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

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/18 10:23:18
一道ACM的入门题:A+B for Input-Output Practice1(入门)DescriptionYour task is to Calculate a + b.InputInput 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
xTjA} YT M ⅍Efv3i7,ED5XSP͍Ԧ>n3i#7( |;9lΛ 'ԝֳN}qZ>}J.ł/ 2d bq#&fĥ\@…)ؾi2>v@r A`.a1L#<\" *"f BR|6a8?ۍE,6:s.:i-h1a&R#Ӆ LdSɤaJ[q/}0y*F;\@LH R Qr| R\agheT}6ݰ98X6{흨tjQ&s'!v|뵿KL3lԣޯU^XlFo߅kՑ^`+(7=D'6q-m

一道ACM的入门题:A+B for Input-Output Practice1(入门)DescriptionYour task is to Calculate a + b.InputInput 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
一道ACM的入门题
:A+B for Input-Output Practice1(入门)DescriptionYour task is to Calculate a + b.InputInput 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.OutputFor 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.Sample Input1 5
10 20
0 0Sample Output6
30我的答案是:#include
int main()
{
int a,b,s;
while(scanf("%d%d",&a,&b)!=EOF)
if((a!=0)&&(b!=0))
{
s=a+b;
printf("%d\n",s);
}
else printf("");
return 0;
}但提交后是“WRONG ANWSER"请高手指点错在哪了,该怎么改

一道ACM的入门题:A+B for Input-Output Practice1(入门)DescriptionYour task is to Calculate a + b.InputInput 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的时候结束呀!而你的不是呀!