蓝桥杯 年号字串

    技术2025-01-30  4

    import java.util.Scanner;

    public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] arr = new int[2500]; int n = scanner.nextInt(); int i = 1; while (n != 0) { if (n % 26 == 0) { arr[i] = 26 + 64; n -= 26; } else { arr[i] = n % 26 + 64; } n /= 26; i++; } for (int j = i - 1; j > 0; j–) { System.out.print((char) (arr[j])); } } }

    Processed: 0.011, SQL: 11