Pagini recente » Cod sursa (job #3256633) | Cod sursa (job #643129) | Cod sursa (job #1951312) | Cod sursa (job #283324) | Cod sursa (job #162230)
Cod sursa(job #162230)
program nunta;
var f,g:Text;
n,i,la,lb,lc,j,t:longint;
a,b,c:array[1..100000]of byte;
begin
assign(f,'nunta.in');
assign(g,'nunta.out');
reset(f);
rewrite(g);
read(f,n);
la:=1;
lb:=1;
a[1]:=1;
b[1]:=1;
for i:=2 to n do
begin
for j:=1 to lb do c[j]:=b[j];
lc:=lb;
t:=0;
for j:=1 to lb do
begin
b[j]:=b[j]+a[j]+t;
t:=b[j] div 10;
b[j]:=b[j] mod 10;
end;
if (t>0)then
begin
inc(lb);
b[lb]:=t;
end;
la:=lc;
for j:=1 to la do a[j]:=c[j];
end;
for i:=lb downto 1 do write(g,b[i]);
close(f);
close(g);
end.