fork download
  1. #include <stdio.h>
  2. #define W 8
  3. #define H 6
  4.  
  5. int main(){
  6. int i,j;
  7.  
  8. char map[H][W]={
  9. {1,1,1,1,1,1,1,1},
  10. {1,0,0,0,0,0,0,1},
  11. {1,0,1,1,1,0,1,1},
  12. {1,0,0,0,0,1,0,1},
  13. {1,0,0,1,0,0,2,1},
  14. {1,1,1,1,1,1,1,1},
  15. };
  16.  
  17. for(i=0;i<=5;i++){
  18. for(j=0;j<=7;j++){
  19. switch(map[i][j]){
  20. case 0:
  21. printf(" ");
  22. break;
  23. case 1:
  24. printf("#");
  25. break;
  26. case 2:
  27. printf("G");
  28. break;
  29. }
  30. }
  31. printf("\n");
  32. }
  33. }
  34.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
########
#      #
# ### ##
#    # #
#  #  G#
########