using System;
namespace Test
{
class Program{
public static void Main(string[] args){
string a=new string(Console.ReadLine());
string b=new string(Console.ReadLine());
Algthrim.A(ref a,ref b);
}
}
class Algthrim{
public static void A(ref string a,ref string b){
int la=a.Length;
int lb=b.Length;
string store=new String("");
int Jin=0;
String Out=new String("");
for(int i=0;i<lb;i++){
Jin=0;
int tmp=(int)(b[i]-'0');
var ans=new System.Text.StringBuilder();
for(int j=la-1;j>=0;j--){
int z=tmp*(int)(a[j]-'0')+Jin;
if(z>=0&&z<10){
ans.Append((char)(z+'0'));
Jin=0;
}else{
Jin=z/10;
ans.Append((char)(z%10+'0'));
}
}
if(Jin!=0){
ans.Append((char)('0'+Jin));
}
Sum(out Out,store,ans.ToString());
store=new String("0"+Out);
}
int ttt=Out.Length;
for(int i=ttt-1;i>=0;i--){
Console.Write("{0}",Out[i]);
}
}
public static void Sum(out string ans,string store,string b){
int ls=store.Length;
int lb=b.Length;
int min=Math.Min(ls,lb);
var k=new System.Text.StringBuilder();
int tag=0;
for(int i=0;i<min;i++){
int tmp=(int)(store[i]-'0')+(int)(b[i]-'0')+tag;
if(tmp>=0&&tmp<=9){
k.Append((char)(tmp+'0'));
tag=0;
}
else{
tag=1;
k.Append((char)(tmp%10+'0'));
}
}
int max=Math.Max(ls,lb);
for(int i=min;i<max;i++){
int tmp;
if(ls==max){
tmp=(int)(store[i]-'0')+tag;
}
else{
tmp=(int)(b[i]-'0')+tag;
}
if(tmp>=0&&tmp<=9){
k.Append((char)(tmp+'0'));
tag=0;
}
else{
tag=1;
k.Append((char)(tmp%10+'0'));
}
}
if(tag==1) k.Append((char)(tag+'0'));
ans=new string(k.ToString());
}
}
}
08-08
1509
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)