Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string repeat(char s, int n) {
- string result;
- for (int i = 0; i < n; i++)
- {
- result += s;
- }
- return result;
- }
- int main() {
- int n;
- cin >> n;
- for (int row = 0; row < n - 3; row++) {
- cout << repeat(' ', n) << "|" << repeat(' ', n) << endl;
- }
- cout << repeat(' ', n - 1) << "_|_" << repeat(' ', n - 1) << endl;
- for (int row = 0; row < n - 3; row++) {
- cout << repeat(' ', n - 1) << "|-|" << repeat(' ', n - 1) << endl;
- }
- cout << repeat(' ', n - 2) << "_|-|_" << repeat(' ', n - 2) << endl;
- for (int row = 0; row < n - 3; row++) {
- cout << repeat(' ', n - 2) << "|***|" << repeat(' ', n - 2) << endl;
- }
- cout << " " << repeat('_', n - 3) << "|***|" << repeat('_', n - 3) << " " << endl;
- for (int row = 0; row < n * 4 - 1; row++) {
- cout << " " << repeat('|', n - 2) << "---" << repeat('|', n - 2) << " " << endl;
- }
- cout << "_" << repeat('|', n - 2) << "---" << repeat('|', n - 2) << "_" << endl;
- for (int row = 0; row < n - 2; row++) {
- cout << repeat('|', n * 2 + 1) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement