题意
给出一个 ,求一个 使得 N=
样例
输入
387420489
输出
9
思路
根据换底公式求出NN的位数,然后判断
代码
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
using namespace std;
string s;
unsigned long long i;
int main()
{
freopen("yy.in","r",stdin);
freopen("yy.out","w",stdout);
cin>>s;
for (i=1;i<=s.size();i++)
if (floor(i*log10(i)+1)==s.size()) break; //求位数
cout<<i;
fclose(stdin);
fclose(stdout);
return 0;
}