program a1 var integer function fib integer integer begin if then fib

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
program a1;
var n : integer;
function fib(n: integer): integer;
begin
if (n = 0) then fib := 1
else if (n = 1) then fib := 2
else if (n = 2) then fib := 3
else fib := fib(n-1)+fib(n-2)+fib(n-3);
end;
begin
write('vvedite N:'); readln(n);
writeln('Fib(N): ', fib(n));
readln;
end.