Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int log(int a)
- {
- int cnt;
- while (a > 1)
- {
- a /= 2;
- cnt++;
- }
- return cnt;
- }
- int main()
- {
- int t, a;
- cin >> t;
- while (t-- > 0)
- {
- cin >> a;
- cout << log(a) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement