此段代码为什么无法输出u形而是只有行输出,求指正
#include <stdio.h>#include<string.h>
void u(char a[], int n)
{
int m, o,i,j,k=-1;
char b[30][30] = {' '};
m = n / 3+1;
o = n - 2 * m;
for (i = 0; i < m; i++)
{
k++;
b[i][0] = a[k];
}
for (j = 1; j < m + o; j++)
{
k++;
b[m - 1][j] = a[k];
}
for (i = m - 1; i >= 0; i--)
{
k++;
b[o + 1][i] = a[k];
}
for (i = 0; i <= m - 1; i++)
{
for (j = 0; j < m + o; j++)
printf("%c", b[i][j]);
}
}
int main()
{
char a[81];
int n;
gets_s(a, 81);
n = strlen(a);
u(a, n);
return 0;
}