文件目录

#include <iostream>
using namespace std;
bool geter(int n)
{
    int n1 = 0, n0 = 0;
    while (n)
    {
        if (n % 2)
            n1++;
        else
            n0++;
        n /= 2;
    }
    return n1 > n0;
}
int main()
{
    int a = 0, b = 0;
    for (int i = 1; i <= 1000; i++)
    {
        if (geter(i))
            a++;
        else
            b++;
    }
    cout << a << " " << b;
    return 0;
}