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; row++) {
- cout << repeat('-', n + 2) << "**" << repeat('-', n + 2) << endl;
- }
- for (int row = 0; row < n - 3; row++) {
- cout << repeat('-', n + 1) << "****" << repeat('-', n + 1) << endl;
- }
- cout << repeat('-', n) << "******" << repeat('-', n) << endl;
- for (int row = 0; row < n - 4; row++) {
- cout << repeat('-', n) << "**--**" << repeat('-', n) << 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 = n - 3; row > 0; row--) {
- cout << repeat('-', row) << "**" << repeat('-', 2 * n + 2 - 2 * row) << "**" << repeat('-', row) << endl;
- }
- cout << "***" << repeat('-', 2 * n) << "***" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement