SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.  
  3. m,n,r,f:array[1..255] of integer;
  4. i,j,p,res,la,lb,dl:integer;
  5. s:string;
  6.  
  7. begin
  8.  
  9. readln(s);
  10. la:=length(s);
  11. i:=la;
  12. while (i >= 1) do begin
  13.   m[length(s)-i+1]:=ord(s[i])-48;
  14.   i:=i-1;
  15. end;
  16.  
  17. readln(s);
  18. lb:=length(s);
  19. i:=lb;
  20. while (i >= 1) do begin
  21.   n[length(s)-i+1]:=ord(s[i])-48;
  22.   i:=i-1;
  23. end;
  24.  
  25. for i:=1 to 255 do
  26.   r[i]:=0;
  27.  
  28. for i:=1 to la do begin
  29.   p:=0;
  30.   for j:=1 to lb do begin
  31.     res:=m[i]*n[j]+p+r[i+j-1];
  32.     r[i+j-1]:=res mod 10;
  33.     p:=res div 10;
  34.   end;
  35.   r[i+j]:=p;
  36. end;
  37.  
  38. i:=255;
  39. while (i>1) and (r[i]=0) do i:=i-1;
  40. dl:=i;
  41.  
  42.  
  43. for i:=dl downto 1 do write(r[i]:3)
  44.  
  45.  
  46. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top