#include<iostream>
#include<string>
using namespace std;
int main(){
int a, b;
while(cin>>a>>b){
cout<<a + b<<endl;
}
}
本文介绍了一个使用C++编写的简单加法计算器程序。该程序通过标准输入接收两个整数,并输出它们的和。利用iostream和string头文件实现基本的输入输出功能。
#include<iostream>
#include<string>
using namespace std;
int main(){
int a, b;
while(cin>>a>>b){
cout<<a + b<<endl;
}
}

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