现在的位置: 首页 > 综合 > 正文

UVA 11636 Hello World!

2019年04月06日 ⁄ 综合 ⁄ 共 327字 ⁄ 字号 评论关闭

大意略。

思路:推数据。

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

抱歉!评论已关闭.