Problem Description
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
#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<algorithm>
#include<string>
#include<sstream>
#include<ctime>
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
int main() {
ios::sync_with_stdio(false);
int a,b;
while(cin>>a>>b){
cout<<a+b<<endl;
}
return 0;
}
本文介绍了一个简单的加法计算器程序,该程序使用C++编写,能够读取输入的两个整数并输出它们的和。程序利用标准输入输出流进行数据交互,并通过关闭标准I/O同步以提高效率。
876

被折叠的 条评论
为什么被折叠?



