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

运行 ID: 168196

#include<iostream> using namespace std; int main() { int x,y,a=0,b=0,c=0,z=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) z++; } cout<<z<<" "<<y-z; }