Pagini recente » Cod sursa (job #1060887) | Cod sursa (job #2712322) | Cod sursa (job #3256921) | Cod sursa (job #2862415) | Cod sursa (job #67706)
Cod sursa(job #67706)
var i,j,h,x,n:longint;
f1,f2:text;
a:array[1..1000000] of longint;
procedure putere;
begin
for j:=1 to x do
begin
h:=a[j]*2+h;
a[j]:=h mod 10;
h:=h div 10;
end;
if h>0 then
begin
inc(x);
a[x]:=h;
h:=0;
end;
end;
begin
assign(f1,'sarpe.in');
reset(f1);
assign(f2,'sarpe.out');
rewrite(f2);
read(f1,n);
a[1]:=1;
x:=1;
if n>1 then
for i:=1 to n+1 do
putere;
for i:=x downto 1 do
write(f2,a[i]);
close(f1);
close(f2);
end.