题目
题意
给一个范围为[1,105]的整数 n,求满足10m <= 2n 的最大整数 m
题解
数论,签到题,对 2n 求对数,然后下取整就行了
代码
#include <algorithm>
#include <bitset>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main(){
double x = log(2)/log(10);
int m;
int t = 1;
while(cin >> m){
int ans = (int)floor(m * x);
printf("Case #%d: %d\n",t++,ans);
}
return 0;
}