hud 6033
题意:给出m,问2的m次方-1==10的k次方(最接近),求k
思路:可以看成2^m=10^k,取个log,k=m*log2/log10
1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 5 int main(){ 6 int n; 7 int kk=1; 8 while(scanf("%d",&n)!=EOF){ 9 printf("Case #%d: ",kk++); 10 int x=log(2)/log(10)*n; 11 printf("%d\n",x); 12 } 13 return 0; 14 }