Код:
var x:array[-1000000..1000000]of longint;i,m,f,n,j,l,lb:longint;a,s,b:string;
Begin

        readln(a);
        readln(b);
                l:=length(a);
                lb:=length(b);
                for i:=l downto 1 do
                for j:=lb downto 1 do
                begin
                        val(a[i],m,f);
                        val(b[j],n,f);
                        x[i+j]:=x[i+j]+(n*m);
                        x[i-1+j]:=x[i+j-1]+(x[i+j]div 10);
                        x[i+j]:=x[i+j] mod 10;
                end;
                a:='';
                for i:=0 to l+lb do
                begin
                        str(x[i],s);
                        a:=a+s;
                end;
                while (a[1]='0')and(length(a)>1) do
                delete(a,1,1);
        writeln(a);
End.

Отредактировано Ильюха ツ Яковлев (2011-05-12 22:05:46)