解题思路:
注意事项:
参考代码:
import java.lang.*; import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long a = sc.nextLong(); BigInteger b = sc.nextBigInteger(); double g = Math.log(b.doubleValue()); double c = g/ Math.log(a); for(int i = 1;i <= 100;i++){ int d = (int)Math.pow(a,i); int e = (int)Math.pow(a,i+1); if((i <= c && c < (i+1)) || (d <= c && d < e)) { System.out.println(i); break; } } } }
0.0分
0 人评分