Guest User

Untitled

a guest
Nov 8th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main() {
  4.     int t;
  5.     cin>>t;
  6.     while(t--){
  7.         int a, b;
  8.         cin>>a>>b;
  9.        int  count = 0;
  10.         for(int i = a; i <= b; i++){
  11.             while(i)
  12.             {
  13.                 i &= (i - 1);
  14.                 count++;
  15.             }
  16.         }
  17.         cout<<count<<endl;
  18.     }
  19.     return 0;
  20. }
Add Comment
Please, Sign In to add comment