UVA 11384 Help is needed for Dexter

#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;
}

 

posted @ 2014-11-03 22:55  Commence  阅读(152)  评论(0编辑  收藏  举报