- 数的计数
- 2010-07-17 15:26:17 @
var n,i,j,k:LONGINT;
procedure cc(s:LONGINT);
begin
inc(i);
for j:=1 to s div 2 do cc(j);
end;
begin
readln(n);
cc(n);
writeln(i);
end.
为什么过不了5555555
1 条评论
-
我是百度啦啦啦 LV 8 @ 2016-08-19 10:40:44
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.
- 1