码迷,mamicode.com
首页 > 其他好文 > 详细

UVA 11384 Help is needed for Dexter

时间:2014-11-03 23:54:14      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   os   for   sp   div   log   

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

 

UVA 11384 Help is needed for Dexter

标签:style   blog   io   color   os   for   sp   div   log   

原文地址:http://www.cnblogs.com/Commence/p/4072430.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!