about summary refs log tree commit diff
path: root/others/volume1/007.pas
blob: 8a544b2f1aaa75692d88603ea6a0ddfae4b0c8d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var
  n, i: int64;
  a, b, c: smallint;

begin
  readln(n);
  a := 1;
  b := 1;
  i := 2;
  while i < n do
    begin
      c := a;
      a := b;
      b := (c + a) mod 1000;
      inc(i)
    end;
  writeln(b)
end.