Cod sursa(job #191453)
Utilizator | Data | 26 mai 2008 19:01:58 | |
---|---|---|---|
Problema | Nunta | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.92 kb |
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 if n=1 then b:=1
else if n=2 then b:=2
else if n=3 then b:=3
else begin
a:=2;
b:=3;
for i:=3 to n do begin
aux:=a+b;
a:=b;
b:=aux
end
end
end;
procedure afisare;
begin
assign(output,'nunta.out');
rewrite(output);
if n mod 2=0 then write(outout,b);
else write(output,b+1);
close(output)
end;
begin
citire;
gasire;
afisare
end.