输出特定的*号阵列
目录:程序员成长之旅/C语言/自己写的源码
#include<stdio.h>
int main() {
int i = 0, j = 0;
char word[5][5] = { //定义为5x5的数组
{' ',' ','*',' ',' '},
{' ','',' ','',' '},
{'',' ',' ',' ',''},
{ ' ','',' ','',' '},
{ ' ',' ','*',' ',' '} };
for (i = 0; i <= 4; i++) {//注意,在使用过程中数组是从0开始的!!!
for (j = 0; j <= 4; j++) {//注意,在使用过程中数组是从0开始的!!!
printf("%c", word[i][j]);
}
printf("\n");
}
return 0;
}
运行截图:
🖼 图片占位(归档模式)图片见原始导出:
%E8%BE%93%E5%87%BA%E7%89%B9%E5%AE%9A%E7%9A%84-%E5%8F%B7%E9%98%B5%E5%88%97.assets/469ff75a-9270-4fa0-84cc-ec2a8e3c8e43.png