#include<iostream> using namespace std; int n; int dfs(int n){return n == 1 ? 1 : dfs(n / 2) + 1;} int main() { while (cin >> n) cout << dfs(n) << endl; return 0; }
#include<iostream> using namespace std; int n; int dfs(int n){return n == 1 ? 1 : dfs(n / 2) + 1;} int main() { while (cin >> n) cout << dfs(n) << endl; return 0; }
转载于:https://www.cnblogs.com/Commence/p/4072430.html