Run ID:41162
提交时间:2022-10-23 16:11:37
#include<iostream> using namespace std; bool judge(int x); int main() { int a=0,b=0; int i; for(i=1; i<=1000; i++) if(judge(i)) a++; else b++; cout<<a<<" "<<b<<endl; return 0; } bool judge(int x) { int a=0,b=0; while(x>0) { if(x%2) a++; else b++; x/=2; } return a>b; }