1
2
3
4
5
6
7
8
9
10base = int(input())
value = int(input())
power = 1
exponent = 0
while power * base <= value:
power *= base
exponent += 1
print(exponent)
复杂度
总结
Markdown Raw
加载中...
noi_openjudge ch0113-49 - 题目
ch0113-49 计算对数
描述
给定两个正整数a(a>1)和b。可以知道一定存在整数x,使得x <= logab < x + 1 或者 ax<= b < ax+1请计算x。