fork download
  1. #include <stdio.h>
  2.  
  3. #define W 8
  4. #define H 6
  5.  
  6. int main(void)
  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. int x, y;
  18.  
  19. for(y = 0; y < H; y++)
  20. {
  21. for(x = 0; x < W; x++)
  22. {
  23. if(map[y][x] == 0)
  24. {
  25. printf(" ");
  26. }
  27. else if(map[y][x] == 1)
  28. {
  29. printf("#");
  30. }
  31. else if(map[y][x] == 2)
  32. {
  33. printf("G");
  34. }
  35. }
  36.  
  37. printf("\n");
  38. }
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
########
#      #
# ### ##
#    # #
#  #  G#
########