一道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/05 11:18:46
![一道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](/uploads/image/z/12636621-45-1.jpg?t=%E4%B8%80%E9%81%93ACM%E7%9A%84%E5%85%A5%E9%97%A8%E9%A2%98%3AA%2BB+for+Input-Output+Practice1%28%E5%85%A5%E9%97%A8%EF%BC%89DescriptionYour+task+is+to+Calculate+a+%2B+b.InputInput+contains+multiple+test+cases.Each+test+case+contains+a+pair+of+integers+a+and+b%2Cone+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
一道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的时候结束呀!而你的不是呀!