delete pics to save space
This commit is contained in:
23
history_source/信息学奥赛一本通/2.6.1.cpp
Normal file
23
history_source/信息学奥赛一本通/2.6.1.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<cstdio>
|
||||
int os(int n)
|
||||
{
|
||||
static int ans;
|
||||
ans=0;
|
||||
while(n>0)
|
||||
{
|
||||
if(n&1) ans++;
|
||||
n/=2;
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int a,b;
|
||||
while(scanf("%d",&a),a!=0)
|
||||
{
|
||||
b=a+1;
|
||||
while(os(a)!=os(b)) b++;
|
||||
printf("%d\n",b);
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user