fork download
  1. #include <iostream>
  2. #define PUT(ch) cout << ch;
  3. #define NL PUT(endl)
  4. #define PUTS(ch,cnt) for (int i = 0; i < cnt; i++) { PUT(ch) }
  5. using namespace std;
  6.  
  7. int main() {
  8. int h, w;
  9. while (true) {
  10. cin >> h >> w;
  11. if (0 == (h | w)) {
  12. break;
  13. }
  14. PUTS('#', w)
  15. NL
  16. for (int j = 2; j < h; j++) {
  17. PUT('#')
  18. PUTS('.', w - 2)
  19. PUT('#')
  20. NL
  21. }
  22. PUTS('#', w)
  23. NL
  24. NL
  25. }
  26. return 0;
  27. }
  28.  
  29.  
Success #stdin #stdout 0s 3344KB
stdin
3 4
5 6
3 3
0 0
stdout
####
#..#
####

######
#....#
#....#
#....#
######

###
#.#
###