提交时间:2024-08-19 23:53:59

运行 ID: 168198

#include<iostream> using namespace std; int main() { long long x,y,a=0,b=0,c=0,z1=0,z2=0; cin>>x>>y; for(int i=x;i<=y;i++) { a=0; b=0; c=i; while(c>0) { if(c%2==1) a++; else b++; c=c/2; } if(a>b) z1++; else z2++; } cout<<z1<<" "<<z2; }