You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
639 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
char chr(int i, int j, int n)
{
if (i > n * 2 + 3) i = n * 4 + 6 - i;
if (j > n * 2 + 3) j = n * 4 + 6 - j;
if (j > i) swap(i, j);
if (i <= 2 && j <= 2) return '.';
if (i % 2 == 1 && j >= i - 2) return '$';
if (j % 2 == 1 && j != i - 1) return '$';
return '.';
}
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n * 4 + 5; i++, putchar('\n'))
for (int j = 1; j <= n * 4 + 5; j++)
putchar(chr(i, j, n));
return 0;
}