fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i,j;
  5. for(i=1;i<=4;i++)
  6. {
  7. char ch = 'A';
  8. for(j=1;j<=7;j++)
  9. {
  10. if(j<=5-i || j>=3+i)
  11. {
  12. printf("%c ",ch);
  13. j<4?ch++:ch--;
  14. }
  15. else
  16. {
  17. printf(" ");
  18. if(i>1 && j==4)
  19. ch--;
  20. }
  21. }
  22. printf("\n");
  23. }
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
A B C D C B A 
A B C   C B A 
A B       B A 
A           A