我想把数组里面的数字用一个圈输出来,但就是以行的形式输出,求大神指教
#include <stdio.h>void main()
{
int i,j;
int f[9][11]={0,0,0,0,0,1,0,0,0,0,0,
0,0,0,0,16,0,2,0,0,0,0,
0,0,0,15,0,0,0,3,0,0,0,
0,0,14,0,0,0,0,0,4,0,0,
0,13,0,0,0,0,0,0,0,5,0,
0,0,12,0,0,0,0,0,6,0,0,
0,0,0,11,0,0,0,7,0,0,0,
0,0,0,0,10,0,8,0,0,0,0,
0,0,0,0,0,9,0,0,0,0,0
};
for (i=0;i<9;i++)//控制行数
{
printf(" ");
for(j=0;j<11;j++)//控制列数
{ if (f[i][j]==0)
printf(" ");
else
printf("%d",f[i][j]);//把相应的数打印出来
}
}
printf("\n");
}