张瑞祥的pascal @ 2016-10-09 20:44:12
const max=200;
var
sa,sb:string;
x:longint;
a,b:array[1..max] of integer;
c:array[1..2*max] of integer;
i,j,la,lb,len:integer;
begin
readln(sa);readln(sb);
if (sa='0') or (sb='0') then begin writeln(0);halt;end;
fillchar(a,sizeof(a),0);
fillchar(b,sizeof(b),0);
fillchar(c,sizeof(c),0);
la:=length(sa);
for i:=1 to la do
a[i]:=ord(sa[la-i+1])-48;
lb:=length(sb);
for i:=1 to lb do
b[i]:=ord(sb[la-i+1])-48;
for i:=1 to la do
for j:=1 to lb do
c[i+j-1]:=c[i+j-1]+a[i]*b[j];
len:=la+lb;
for i:=1 to len do
begin
c[i+1]:=c[i+1]+c[i] div 10;
c[i]:=c[i] mod 10;
end;
while c[len]=0 do len:=len-1;
x:=c[len];
while x>0 do
begin
c[len]:=x mod 10;
x:=x div 10;
len:=len+1;
end;
for i:=len-1 downto 1 do
write(c[i]);
end.
by skiyalg @ 2017-06-20 10:03:26
是后面两个点没过吗
by 给我一个笑容 @ 2020-03-29 13:45:02
我也是神奇的六十