c6-7.c 268 B

1234567891011
  1. #include <stdio.h>
  2. int main()
  3. {char diamond[][5]={{' ',' ','*'},{' ','*',' ','*'},{'*',' ',' ',' ','*'},{' ','*',' ','*'},{' ',' ','*'}};
  4. int i,j;
  5. for (i=0;i<5;i++)
  6. {for (j=0;j<5;j++)
  7. printf("%c",diamond[i][j]);
  8. printf("\n");
  9. }
  10. return 0;
  11. }