大佬可以帮我找一下错误原因吗,谢谢
#include<stdio.h>
int main() {
int N,a,b;
scanf("%d", &N);
while (N-- > 0) {
scanf("%d%d", &a, &b);
char image[40][40] = {' '};
for (int i = 0; i < a; i++) {
image[i][i] = 'X';
image[i][a - 1 - i] = 'X';
}
for (int j = 1; j <= b; j++) {
if (j == 1) {
for (int i = 0; i < a; i++) {
for (int k = 0; k < a; k++)
printf("%c", image[i][k]);
printf("\n");
}
}
else {
for (int i = 1; i < a; i++) {
for (int k = 0; k < a; k++)
printf("%c", image[i][k]);
printf("\n");
}
}
}
printf("\n");
}
}
2020-02-14 12:41:09