image.png
import java.util.Scanner;
public class Main {
public static void main(String[] args){
QUE q = new QUE();
Scanner sc = new Scanner(System.in);
int a=sc.nextInt(), b=sc.nextInt();
q.show(b);
for(int i = 1; i < a; i++){
char hed = (char)(('A'+i%26));
q.headin(hed);
q.show(b);
}
}
}
class QUE{
char[] a = new char[26];
public QUE(){
for(int i = 0; i < 26; i++){
a[i] = (char)('A'+i);
}
}
public void show(int n){
for (int i = 0; i < n; i++){
System.out.print(a[i]);
}
System.out.println();
}
public void headin(char x){
for(int i = 25; i >0; i--){
a[i] = a[i-1];
}
a[0]=x;
}
}
网友评论