提交时间:2024-08-19 17:25:07

运行 ID: 167778

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