A*B Problem
高精度压位,不解释。。
type
hp=array[0..15000] of longint;
var
a,b,ans:hp;
procedure h_cheng(a,b:hp;var c:hp);
var
i,j,len:longint;
begin
len:=a[0]+b[0];
fillchar(c,sizeof(c),0);
for i:=1 to a[0] do
for j:=1 to b[0] do begin
c[i+j-1]:=c[i+j-1]+a[i]*b[j];
c[i+j]:=c[i+j]+c[i+j-1] div 10000;
c[i+j-1]:=c[i+j-1] mod 10000;
end;
while (c[len]=0)and(len>1) do dec(len); c[0]:=len;
end;
procedure print(a:hp);
var
i:longint;
begin
write(a[a[0]]);
for i:=a[0]-1 downto 1 do begin
if a[i] div 1000=0 then write(0);
if a[i] div 100 =0 then write(0);
if a[i] div 10 =0 then write(0);
write(a[i]);
end;
end;
procedure main;
var
i,n:longint;
c:char;
begin
readln(n);
fillchar(a,sizeof(a),0);
a[0]:=(n-1)div 4+1;
for i:=1 to n do begin
read(c);
a[(n-i+1-1)div 4+1]:=a[(n-i+1-1)div 4+1]*10+ord(c)-ord('0');
end; readln;
fillchar(b,sizeof(b),0);
b[0]:=(n-1)div 4+1;
for i:=1 to n do begin
read(c);
b[(n-i+1-1)div 4+1]:=b[(n-i+1-1)div 4+1]*10+ord(c)-ord('0');
end; readln;
h_cheng(a,b,ans);
print(ans);
end;
begin
main;
end.