提交时间:2024-08-19 16:07:38

运行 ID: 167101

#include <bits/stdc++.h> using namespace std; int main() { int p,a,b,good,ta=0,tb=0,x,y; cin>>x>>y; for(; x<=y; x++) { p=x,a=0,b=0; while(j) { good=j%2; p>>=1; if(good) a++; else b++; } if(a>b) ta++; else tb++; } cout<<ta<<' '<<tb; return 0; }