UVA 11636 Hello World!

来源:互联网 发布:电脑上多重网络 编辑:程序博客网 时间:2024/04/29 03:45

大意略。

思路:推数据。

#include <iostream>#include <cstdlib>#include <cstdio>#include <string>#include <cstring>#include <cmath>#include <vector>#include <queue>#include <stack>#include <algorithm>using namespace std;int main(){int times = 0;int n;while(scanf("%d", &n) && n >= 0){int t = 1, ans = 0;while(t < n) { t *= 2; ans++; }printf("Case %d: %d\n", ++times, ans);}return 0;}


原创粉丝点击