A+B problem c++

Each line will contain two integers A and B. Process to end of file.

For each case, output A + B in one line.

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

 用while循环处理process to end of file

猜你喜欢

转载自blog.csdn.net/qq_43686320/article/details/84866265