描述
你的任务是计算a+b。这是为了acm初学者专门设计的题目。你肯定发现还有其他题目跟这道题的标题类似,这些问题也都是专门为初学者提供的。
输入两个数,回车后输出结果,然后再输入一对,回车再输出结果。。。。
PS:这不是一道签到题喔,是给有基础伙伴的入班测试题。根据上方加粗文字,你看到深深的坑了吗?
输入描述
输入包含一系列的a和b对,通过空格隔开。一对a和b占一行。
输出描述
对于每次输入的每对a和b,你需要依次输出a、b的和。
用例输入 1
1 5
用例输出 1
6
//C语言
#include<iostream>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
printf("%d\n",a+b);
}
return 0;
}
//c++
#include<iostream>
using namespace std;
int main() {
int a,b;
while(cin>>a>>b)
{
cout<<a+b<<endl;;
}
return 0;
}
//python
while True:
try:
s = list(map(int, input().strip().split()))
print(s[0] + s[1])
except:
break