示例代码:
#include <stdio.h>
#define N 26
int main(void)
{
int i = 0 , j = 0 , k = 0;
int n = 0 , m = 0 ;
char arr[N] = {'A'};
scanf("%d %d",&n,&m);
for (i = 1 ; i < N ; i ++)
{
arr[i] = arr[i-1] + 1;
}
for (i = 0 ; i < n ; i ++)
{
k = i;
for (j = 0 ; j < m ; j ++)
{
if (k)
{
printf("%c",arr[k]);
k --;
}
else
{
printf("%c",arr[j-i]);
}
}
printf("\n");
}
return 0;
}