UVa 11384 - Help is needed for Dexter

传送门

UVa 11384 - Help is needed for Dexter

代码

#include <cstdio>
using namespace std;
 
int Fun(int n)
{
    if (n == 1)
        return 1;
    return Fun(n / 2) + 1;
}
 
int main()
{
    //freopen("input.txt", "r", stdin);
    int n, i, j;
    while (~scanf("%d", &n))
        printf("%d\n", Fun(n));
    return 0;
}

Powered by Jekyll and Theme by solid