总时间限制:
1000ms
内存限制:
65536kB
描述
给定两个正整数a(a>1)和b。可以知道一定存在整数x,使得
x <= logab < x + 1 或者 ax<= b < ax+1
请计算x。
输入
两行,第一行是a,第二行是b。每个整数均不超过100位。
输出
一行,即对应的x。输入数据保证x不大于20。
样例输入
10000
1000000000001
样例输出
3
解题代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
int cit;
double ade, bde;
cin >> ade >> bde;
cit = log10(bde) / log10(ade);
cout << cit;
return 0;
}