习题:用字符数组输出钻石图像
1 /*用字符数组输出钻石图像*/ 2 #include<stdio.h> 3 int main(void) 4 { 5 static char c[][5]={{' ',' ','*'},{' ','*',' ','*'},{'*',' ',' ',' ','*'},\ 6 {' ','*',' ','*'},{' ',' ','*'}}; 7 int i,j; 8 for (i=0;i<5;i++) 9 { 10 for(j=0;j<5;j++) 11 { 12 printf("%c",c[i][j]); 13 } 14 putchar('\n'); 15 } 16 }