#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char a[100], b[100], n[100];
int c, d, e, f, g, h, i, j, k, l, m, y, r;
cin >> a >> b;
strrev(a);
strrev(b);
c = strlen(a);
d = strlen(b);
char x[d][100];
i = 0;
while(i != d)
{
y = j = 0;
f = b[i] - 48;
for(j=0;j<i;j++)
{
x[i][j] = 48;
}
for(k=0;k<c;k++)
{
e = a[k] - 48;
g = e*f+y;
x[i][k+j] = (g%10) + 48;
y = g/10;
}
if(y>0)
{
x[i][k+j] = y + 48;
k++;
}
x[i][k+j] = '\0';
i++;
}
h = -1;
for(j=0;j<d;j++)
{
r = strlen(x[j]);
if(h<r)
h = r;
}
return 0;
}
#include<cstring>
using namespace std;
int main()
{
char a[100], b[100], n[100];
int c, d, e, f, g, h, i, j, k, l, m, y, r;
cin >> a >> b;
strrev(a);
strrev(b);
c = strlen(a);
d = strlen(b);
char x[d][100];
i = 0;
while(i != d)
{
y = j = 0;
f = b[i] - 48;
for(j=0;j<i;j++)
{
x[i][j] = 48;
}
for(k=0;k<c;k++)
{
e = a[k] - 48;
g = e*f+y;
x[i][k+j] = (g%10) + 48;
y = g/10;
}
if(y>0)
{
x[i][k+j] = y + 48;
k++;
}
x[i][k+j] = '\0';
i++;
}
h = -1;
for(j=0;j<d;j++)
{
r = strlen(x[j]);
if(h<r)
h = r;
}
return 0;
}
Comments
Post a Comment