关于简单的C语言的ACM,Problem DescriptionYour task is to Calculate a + b.Too easy?Of course!I specially designed the problem for acm beginners.You must have found that some problems have the same titles with this one,yes,all these problems wer
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 06:50:23
关于简单的C语言的ACM,Problem DescriptionYour task is to Calculate a + b.Too easy?Of course!I specially designed the problem for acm beginners.You must have found that some problems have the same titles with this one,yes,all these problems wer
关于简单的C语言的ACM,
Problem DescriptionYour task is to Calculate a + b.
Too easy?Of course!I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one,yes,all these problems were designed for the same aim.
InputThe input will consist of a series of pairs of integers a and b,separated by a space,one pair of integers per line.
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
Sample Output6
30
Authorlcy
RecommendJGShining我的答案是
#include
void main()
{
int a1,a2,a3,b1,b2,b3;
scanf("%d%d%d%d",&a1,&a2,&b1,&b2);
a3=a1+a2;
b3=b1+b2;
printf("%d\n%d\n",a3,b3);
}
提示答案是错的,到底哪里错了呢
关于简单的C语言的ACM,Problem DescriptionYour task is to Calculate a + b.Too easy?Of course!I specially designed the problem for acm beginners.You must have found that some problems have the same titles with this one,yes,all these problems wer
#include
int main()
{
int a, b;
while(scanf("%d%d",&a,&b)) //一直读取知道输入EOF
printf("%d\n", a+b);
return 0;
}