Pagini recente » Cod sursa (job #1017665) | Cod sursa (job #527697) | Cod sursa (job #1798710) | Cod sursa (job #117202) | Cod sursa (job #191442)
Cod sursa(job #191442)
var n,a,b,aux:longint;
procedure citire;
begin
assign(input,'nunta.in');
reset(input);
read(input,n);
close(input)
end;
procedure gasire;
var i:integer;
begin if n=1 then b:=1
else if n=2 then b:=2
else if b=3 then b:=3
else if n<14 then begin
a:=1;
b:=1;
for i:=1 to n do begin
aux:=a+b;
a:=b;
b:=aux
end
end
end;
procedure afisare;
begin
assign(output,'nunta.out');
rewrite(output);
write(output,b);
close(output)
end;
begin
citire;
gasire;
afisare
end.