#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int a[100001],b[100001],c[100001],lena,lenb,lenc,i,j,x; char n[100001],n1[100001],n2[100001]; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); memset(c,0,sizeof(c)); scanf("%s",n1); scanf("%s",n2); lena=strlen(n1); lenb=strlen(n2); for(j=0;j<=lena-1;j++)a[lena-j]=n1[j]-48; for(j=0;j<=lenb-1;j++)b[lenb-j]=n2[j]-48; i=1;x=0; while(i<=lena||i<=lenb) { x=(a[i]+b[i]+c[i])/10; c[i]=(a[i]+b[i]+c[i])%10; c[i+1]+=x; i++; } lenc=i; while(c[lenc]==0&&lenc>1)//如果最高为上为零,lenc减一,消去 lenc--; for(i=lenc;i>=1;i--)//此for用来一位一位倒序输出 cout<<c[i]; return 0; }