第一期作业第四题

题目:
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
Sample Output
2
翻译版:
计算a+b。

输入

每一行将包含两个整数A和B进程到文件结束。

产量

对于每种情况,在一行中输出A+B。

样本输入

1 1

样本输出


代码:

#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
	int a, b;
	while (cin >> a >> b)
	{
		cout << a + b << endl;
	}
	return 0;
}

解释
用了加法进行计算

猜你喜欢

转载自blog.csdn.net/weixin_44003016/article/details/84886576