a,b,c:array[0..50001] of longint;
t:array[0..50001] of char;
st:char;
stemp:string;
begin
readln(n);
n4:= (n-1) div 4+1;
fillchar(a,sizeof(a),0);
fillchar(b,sizeof(b),0);
fillchar(c,sizeof(c),0);
fillchar(t,sizeof(t),’0’);
i:=n;
repeat
read(st);
t[i]:=st;
dec(i);
until i=0;
for i:= n4 downto 1 do begin
stemp:=’’;
stemp:=stemp+t[4*i-0];
stemp:=stemp+t[4*i-1];
stemp:=stemp+t[4*i-2];
stemp:=stemp+t[4*i-3];
val(stemp,a[i]);
end;
readln;
fillchar(t,sizeof(t),’0’);
i:=n;
repeat
read(st);
t[i]:=st;
dec(i);
until i=0;
for i:= n4 downto 1 do begin
stemp:=’’;
stemp:=stemp+t[4*i-0];
stemp:=stemp+t[4*i-1];
stemp:=stemp+t[4*i-2];
stemp:=stemp+t[4*i-3];
val(stemp,b[i]);
end;
for i:= 1 to n4 do
for j:= 1 to n4 do begin
c[i+j-1]:=a[i]*b[j]+c[i+j-1];
c[i+j]:= c[i+j]+c[i+j-1] div 10000;
c[i+j-1]:= c[i+j-1] mod 10000;
end;
i:= 50000;
while c[i] = 0 do dec(i);
write(c[i]);
for j:= i-1 downto 1 do begin
write(c[j] div 1000 mod 10);
write(c[j] div 100 mod 10);
write(c[j] div 10 mod 10);
write(c[j] div 1 mod 10);
end;
end.
给我吧
begin
readln(n);
readln(a);
readln(b);
writeln(a*b);
end.
[color=green]简化版...