给出2个大整数A,B,计算A+B的结果。
Input
第1行:大数A 第2行:大数B (A,B的长度 <= 10000 A B为正数)
Output
输出A + B
Input示例
68932147586 468711654886
Output示例
537643802472
#include<cstdio>
#include <cstring>
#include<iostream>
#include<cmath>
#include <stack>
using namespace std;
typedef long long LL;
int main()
{
stack <int> a,b,c;
char m[100000],n[100000];
gets(m);
gets(n);
int la=strlen(m),lb=strlen(n);
//printf("%d %d\n",la,lb);
int i,j,k;
for(i=0;i<la;i++)
{
char t=m[i]-48;
a.push(t);
//printf("%d ",t);
}
for(i=0;i<lb;i++)
{
char t=n[i]-48;
b.push(t);
//printf("%d ",t);
}
int e=0;
for(;;)
{
int t,u,g=0;
if(!a.empty())
{
t=a.top();
a.pop();
}
else
t=0;
if(!b.empty())
{
u=b.top();
b.pop();
}
else
u=0;
g=t+u+e;
if(g>=10)
{
g=g%10;