#include<bits/stdc++.h>
#define LL long long
#define pf printf
#define sf scanf
using namespace std;
main()
{
string s,s1,s2;
while(cin>>s>>s1)
{
long long l,l1,l2,i,k2,k1,k,carry=0,cnt=0;
l=s.size();
l1=s1.size();
l2=max(l,l1);
for(i=l2-1;i>=0;i--)
{
k=s[i]-48;
k1=s1[i]-48;
k2=k+k1+carry;
if(k2>9)
{
carry=1;
k2=k2-10;
}
else
{
carry=0;
k2=k2;
}
s2[i]=k2+48;
cnt++;
}
if(carry==1)
{
cout<<1;
//cnt++;
}
for(i=0;i<cnt;i++)
{
cout<<s2[i];
}
}
}
#define LL long long
#define pf printf
#define sf scanf
using namespace std;
main()
{
string s,s1,s2;
while(cin>>s>>s1)
{
long long l,l1,l2,i,k2,k1,k,carry=0,cnt=0;
l=s.size();
l1=s1.size();
l2=max(l,l1);
for(i=l2-1;i>=0;i--)
{
k=s[i]-48;
k1=s1[i]-48;
k2=k+k1+carry;
if(k2>9)
{
carry=1;
k2=k2-10;
}
else
{
carry=0;
k2=k2;
}
s2[i]=k2+48;
cnt++;
}
if(carry==1)
{
cout<<1;
//cnt++;
}
for(i=0;i<cnt;i++)
{
cout<<s2[i];
}
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন