https://www.51nod.com/onlineJudge/submitList.html#!userId=17562&problemId=1027
#include <iostream>
#include <stdio.h>
#include <cstring>
using namespace std;
char a[1005];
char b[1005];
int c[3000];
void muli()
{
int lena=strlen(a)-1;
int lenb=strlen(b)-1;
for(int i=lena;i>=0;i--)
{
for(int j=lenb;j>=0;j--)
{
c[i+j]+=(a[i]-'0')*(b[j]-'0');
}
}
for(int i=lenb+lenb;i>=0;i--)
{
if(i!=0)
{
c[i-1]+=c[i]/10;
c[i]%=10;
}
else
{
if(c[0]/10!=0)
printf("%d",c[0]/10);
c[0]%=10;
}
}
for(int i=0;i<=lena+lenb;i++)
cout<<c[i];
}
int main()
{
gets(a);
gets(b);
muli();
return 0;
}