第二题的思路,不知道对不对 public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int x = sc.nextInt(), y = sc.nextInt(); int result = Math.max(1, (int) Math.log10(x / Math.pow(26, y))); System.out.printf("%d\n", result); } }