Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BasicsExam17September2017.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int print_count = n;
- int width = 3 * n;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "/";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "\\";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "|";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "x";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "x";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = (width - (2 * n + 1))/2; i > 0; i--)
- {
- cout << string(i, '.');
- cout << string(print_count, 'x');
- cout << "|";
- cout << string(print_count, 'x');
- cout << string(i, '.') << endl;
- print_count++;
- }
- for (int i = 0; i < (width - (2 * n - 1)) / 2; i++)
- {
- cout << string(i, '.');
- cout << string(print_count, 'x');
- cout << "|";
- cout << string(print_count, 'x');
- cout << string(i, '.') << endl;
- print_count--;
- }
- print_count = n;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "/";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "\\";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "\\";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "/";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = (width - (2 * n + 1)) / 2; i > 0; i--)
- {
- cout << string(i, '.');
- cout << string(print_count, 'x');
- cout << "|";
- cout << string(print_count, 'x');
- cout << string(i, '.') << endl;
- print_count++;
- }
- for (int i = 0; i < (width - (2 * n - 1)) / 2; i++)
- {
- cout << string(i, '.');
- cout << string(print_count, 'x');
- cout << "|";
- cout << string(print_count, 'x');
- cout << string(i, '.') << endl;
- print_count--;
- }
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "|";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "x";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "x";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else if (i == ((width / 2) - 1))
- {
- cout << "\\";
- }
- else if (i == ((width / 2) + 1))
- {
- cout << "/";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- if (i == width / 2)
- {
- cout << "x";
- }
- else
- {
- cout << '.';
- }
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment