public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.in); System.out.println(cal(scanner.nextInt())); } static String cal(int n) { if(n==1) { return "A"; } else { return cal(n-1)+(char)(‘A‘+n-1)+cal(n-1); } }
蓝桥杯——基础练习之FJ的字符串,布布扣,bubuko.com
原文地址:http://blog.csdn.net/hymanxq/article/details/25836453