uva 11636Hello World!

简介: 点击打开链接uva11636 水题 #include#include#include#includeusing namespace std;int solve(int n){ int ans = 0; int ...

点击打开链接uva11636

水题

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

int solve(int n){
    int ans = 0;
    int num = 1;
    while(num < n){
        ans++;
        num *= 2;
    }
    return ans;
}

int main(){
    int Case = 1 , n;
    while(scanf("%d" , &n) && n > 0)
        printf("Case %d: %d\n" , Case++ , solve(n));
    return 0;
}




目录
相关文章
UVA 11636-Hello World!(水题,猜结论)
UVA11636-Hello World! Time limit: 1.000 seconds When you first made the computer to print the sentence “Hello World!”, you felt so happy, not knowing...
1091 0
|
机器学习/深度学习 Java 网络架构
|
机器学习/深度学习 算法
|
机器学习/深度学习