Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- int H, W, m, n;
- while (1) {
- scanf("%d%d", &H, &W);
- if (H == 0 || W == 0) { break; }
- m = n = 1;
- while (m <= H && n <= W) {
- if (m != 1 && m != H && n != 1 && n != W) {
- printf("."); n++; continue;
- }
- printf("#");
- // tail? then newline
- if (n == W) { printf("\n"); n = 1; m++; }
- else { n++; }
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement