文章
227
粉丝
0
获赞
1000
访问
38.3k
#include<iostream>
using namespace std;
string a,b;
void work()
{
int t=0;
for(int i=a.size()-1;i>=0;i--)
{
int x=a[i]-'0';
int y=b[i]-'0';
int res=x+y+t;
t=res/10;
res=res%10;
a[i]='0'+res;
}
if(t==1)
cout<<t;
cout<<a<<endl;
}
int main()
{
while(cin>>a>>b)
work();
return 0;
}
登录后发布评论
暂无评论,来抢沙发