讨论 / 大牛看看哪儿错了!!!
Mine_浅蓝 2010-05-22 18:00:00
点我顶贴 收藏 删除
[color=red]

var

i,start,finish,total:int64;

procedure jz;

var

code,n,t1,t2:int64;

begin

t1:=0;

t2:=0;

n:=i;

repeat

code:=n mod 2;

if code=1 then inc(t1);

if code=0 then inc(t2);

n:=n div 2;

until n=0;

if t1<=t2 then inc(total);

end;

begin

read(start,finish);

i:=start-1;

repeat

inc(i);

jz;

until i=finish;

write(total);

end.

[/color]

查看更多回复
提交回复