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