TOJ 4102 White Rats

The description of this problem is misunderstanding.Because I can make one LAB rats drink wines till dead.

The portal:http://acm.tju.edu.cn/toj/showp4102.html

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

long long f[105];

void Deal_with(){
    int T;
    f[0] = 1;
    for(int i=1;i<=32;i++){
        f[i] = f[i-1] * 2;
    }
    scanf("%d",&T);
    while(T--){
        long long n;
        scanf("%lld",&n);
        for(int i=0;i<=32;i++){
            if(f[i] >= n){
                printf("%d\n",i);
                break;
            }
        }
    }
}

int main(void){
    Deal_with();
    return 0;
}



相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页