加法模拟器答案(C++)
#include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a<<"+"<<b<<"="<<a+b<<endl; cout<<right<<setw(7)<<a<<endl; cout<<"+"<<right<<setw(6)<<b<<endl; cout<<"-------"<<endl; cout<<right<<setw(7)<<a+b<<endl; return 0; }
以上仅供参考