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