-----------------------------------------------------------------
不知道说啥
感觉好像偏离主体思想了
但是这样写好简单
-----------------------------------------------------------------
算法
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
char[] ch = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
'O','P','Q','R','S','T','U','V','W','X','Y','Z'};
String st = "";
for(int i=0;i<m;i++)
st += ch[i];
for(int i=0;i<n;i++){
String st1,st2;
if(i!=0){
st1 = st.substring(0, st.length()-1);
st2 = ch[i]+"";
st = st2+st1;
}
System.out.println(st);
}
}
}