讨论 / 求此题标程
luckyboy 2008-11-03 00:33:00
点我顶贴 收藏 删除
求此题标程
#1 luckyboy@2008-11-03 00:09:00
回复 删除
给对方
#2 WuOfZ@2008-11-03 00:32:00
回复 删除
啥叫给对方?
#3 WuOfZ@2008-11-03 00:32:00
回复 删除
var n,n4,i,j:word;

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.

给我吧

#4 WuOfZ@2008-11-03 00:33:00
回复 删除
var a,b,n:qword;

begin

readln(n);

readln(a);

readln(b);

writeln(a*b);

end.

[color=green]简化版...

查看更多回复
提交回复