Pagini recente » Cod sursa (job #1847710) | Cod sursa (job #641996) | Cod sursa (job #130576) | Cod sursa (job #2744342) | Cod sursa (job #191459)
Cod sursa(job #191459)
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:longint;
begin
assign(output,'nunta.out');
rewrite(output);
if n=1 then write(output,1)
else if n=2 then write(output,2)
else if n=3 then write(output,3)
else begin
a:=2;
b:=3;
for i:=3 to n do begin
aux:=a+b;
a:=b;
b:=aux
end;
write(output,b)
end;
close(output)
end;
begin
citire;
gasire
end.