问题描述
Java 代码实现
import java.util.*; public class Main{ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); char[][] a = new char[n+5][m+5]; char ch = 'A'; for (int i = 0; i < m+5; ++i) { a[0][i] = (char)(ch+i); } for (int i = 0; i < n+5; ++i) { a[i][0] = (char)(ch+i); } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { a[i][j] = a[i-1][j-1]; System.out.printf("%c", a[i][j]); } System.out.println(); } in.close(); } }