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




目录
相关文章
|
6月前
|
Java
HDU-2120-Ice_cream's world I
HDU-2120-Ice_cream's world I
28 0
UVa11076 - Add Again
UVa11076 - Add Again
55 0
uva127 "Accordian" Patience
uva127 "Accordian" Patience
42 0
UVa343 What Base Is This
UVa343 What Base Is This
47 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...
1124 0
|
机器学习/深度学习 算法