M3TILE - LATGACH3
Tác giả: RR
Ngôn ngữ: Pascal
{$R+,Q+}
uses math;
const
FINP='';
FOUT='';
MAXN=30;
var
f1,f2:text;
f:array[0..MAXN] of longint;
n:longint;
procedure openF;
begin
assign(f1,FINP); reset(f1);
assign(f2,FOUT); rewrite(f2);
end;
procedure closeF;
begin
close(f1);
close(f2);
end;
procedure init;
var
i,j:longint;
begin
f[0]:=1;
for i:=1 to MAXN do
if i mod 2=1 then f[i]:=0
else
begin
for j:=0 to i-2 do
f[i]+=2*f[j];
f[i]+=f[i-2];
end;
end;
begin
init;
openF;
read(f1,n);
while n>=0 do
begin
writeln(f2,f[n]);
read(f1,n);
end;
closeF;
end.