Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int width = 50;
- int height = 30;
- void drawGenericRectangle(int positionX, int positionY)
- {
- int rectangleX[10];
- int rectangleY[5];
- for (int c = 0; c < 10; c++)
- {
- rectangleX[c] = positionX + c;
- }
- for (int p = 0; p < 5; p++)
- {
- rectangleY[p] = positionY + p;
- }
- bool flag = false;
- for (int y = 0; y < height; y++)
- {
- for (int x = 0; x < width; x++)
- {
- flag = false;
- for (int w = 0; w < 5; w++)
- {
- if (y == rectangleY[w])
- {
- for (int d = 0; d < 10; d++)
- {
- if (x == rectangleX[d])
- {
- flag = true;
- cout << "#";
- }
- }
- }
- }
- if (flag == false)
- cout << " ";
- }
- cout << endl;
- }
- }
- int main()
- {
- drawGenericRectangle(10, 4);
- int pause; cin >> pause;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement