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) {
- printf("#");
- if (n == W) { printf("\n"); n = 1; m++; }
- else { n++; }
- continue;
- }
- if (m == H) {
- printf("#");
- if (n == W) { printf("\n"); n = 1; m++; }
- else { n++; }
- continue;
- }
- if (n == 1) {
- printf("#");
- if (n == W) { printf("\n"); n = 1; m++; }
- else { n++; }
- continue;
- }
- if (n == W) {
- printf("#\n"); n = 1; m++; continue;
- }
- printf("."); n++;
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement