讨论 / 为什么没输出啊
赵炳 2014-07-12 09:57:47
点我顶贴 收藏 删除
program ganjingduchengfa;

const max=200000;

var a,b,c:array[1..max] of longint;

n1,n2:ansistring;

n,i,j,x:longint;

begin

readln(n);

readln(n1);

readln(n2);

for i:=1 to n do a[n-i+1]:=ord(n1[i])-ord('0');

for i:=1 to n do b[n-i+1]:=ord(n2[i])-ord('0');

for i:=1 to n do

begin

x:=0;

for j:=1 to n do

begin

c[i+j-1]:=a[i]*b[j]+x+c[i+j-1];

x:=c[i+j-1] div 10;

c[i+j-1]:=c[i+j-1] mod 10;

end;

n:=n+n;

end;

while (c[n]=0)and(n>1) do dec(n);

for i:=n downto 1 do write(c[i]);

end.

查看更多回复
提交回复