- 数的计数
- 2012-10-19 19:40:30 @
var a,b,c,d,e,f,g,h,i,j,k,l,s,n:longint;
begin
readln(n);
if n div 2 = 0 then n:=n-1;
for i:=1 to n div 2 do
begin
s:=s+1;
for a:=1 to i div 2 do
begin
s:=s+1;
for b:= 1 to a div 2 do
begin
s:=s+1;
for c:= 1 to b div 2 do
begin
s:=s+1;
for d:= 1 to c div 2 do
begin
s:=s+1;
for e:= 1 to d div 2 do
begin
s:=s+1;
for f:= 1 to e div 2 do
begin
s:=s+1;
for g:= 1 to f div 2 do
begin
s:=s+1;
end;
end;
end;
end;
end;
end;
end;
end;
s:=s+1;
writeln(s);
end.
3 条评论
-
zrzluck99 LV 9 @ 2016-10-30 18:26:28
begin write('**666**'); end.
-
2016-02-23 21:19:48@
var
n,ans:longint;
procedure doit(t:longint);
var
i:longint;
begin
if t>0 then
for i:=1 to t do
inc(ans);
for i:=1 to t do
doit(i div 2);
end;
begin
readln(n);
doit(n div 2);
writeln(ans+1);
end. -
2015-09-01 12:20:59@
2012-10-19 19:40
- 1