SlepoiKrot

Untitled

Jan 2nd, 2018
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.   n, i: integer;
  3.   m: int64;
  4. begin
  5.   readln (n);
  6.   m := 1;
  7.   for i := 1 to n do begin
  8.     m := m * i;
  9.     while (m mod 10 = 0) do begin
  10.       m := m div 10;
  11.     end;
  12.     m := m mod 1000;
  13.   end;
  14.   writeln (m mod 10);
  15.   readln;
  16.   readln;
  17. end.
RAW Paste Data