SlepoiKrot

Untitled

Feb 20th, 2018
78
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program NUMBER1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils, Math;
  7. var
  8. s1, s2: string;
  9. i, asize, bsize, per, j : integer;
  10. a, b, sum: array [1..10001] of integer;
  11. begin
  12. readln (s1, s2);
  13. asize := 10001;
  14. bsize := 10001;
  15. for i := length (s1) downto 1 do begin
  16. dec (asize);
  17. a[asize] := ord(s1[i]) - 48;
  18. end;
  19. for i := length (s2) downto 1 do begin
  20. dec (bsize);
  21. b[bsize] := ord(s2[i]) - 48;
  22. end;
  23. per := 0;
  24. for i := 10000 downto 1 do begin
  25. per := per + a[i] + b[i];
  26. sum [i] := per mod 10;
  27. per := per div 10;
  28. end;
  29. j := 1;
  30. while (sum[j] = 0) do begin
  31. inc (j);
  32. end;
  33. for i := j to 10000 do begin
  34. write(sum[i], ' ');
  35. end;
  36.  
  37. readln;
  38. readln;
  39. end.
RAW Paste Data