Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137553 hjx5 二进制数问题 C++ Accepted 0 MS 260 KB 317 2025-11-19 15:16:52

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int i,j,a,b,s,s1; i=1; s=s1=0; while (i<=1000) { j=i; a=b=0; while (j!=0) { if (j%2==1) a=a+1; else b=b+1; j=j/2; } if (a>b) s++; else s1++; i++; } cout<<s<<" "<<s1<<endl; return 0; }