delete pics to save space
This commit is contained in:
25
history_source/信息学奥赛一本通/1.6.1.16.cpp
Normal file
25
history_source/信息学奥赛一本通/1.6.1.16.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include<cstdio>
|
||||
int one=0,zero=0;
|
||||
bool isa(int n)
|
||||
{
|
||||
one=zero=0;
|
||||
do
|
||||
{
|
||||
if(n&1) one++;
|
||||
else zero++;
|
||||
n>>=1;
|
||||
}
|
||||
while(n);
|
||||
return one>zero;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int a=0,b=0;
|
||||
for(int i=1;i<=1000;i++)
|
||||
{
|
||||
if(isa(i)) a++;
|
||||
else b++;
|
||||
}
|
||||
printf("%d %d\n",a,b);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user