Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication3.cpp : main project file.
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- using namespace System;
- void DibujaRectangulo(char c, int x, int y, int color, int an, int al)
- {
- Console::ForegroundColor = (ConsoleColor)color;
- for (int i = 0; i < al; i++)
- {
- Console::SetCursorPosition(x, y);
- for (int q = 0; q < an; q++) { cout << c; }
- y++;
- }
- }
- int main()
- {
- char c;
- int x, y, color, an, al;
- cout << "Ingrese el caracter a imprimir: " << endl;
- cin >> c;
- cout << "Ingrese las coordenadas x y y: " << endl;
- cin >> x >> y;
- cout << "Ingrese el color del texto: " << endl;
- cin >> color;
- cout << "Ingrese el ancho y el alto: " << endl;
- cin >> an >> al;
- DibujaRectangulo(c, x, y, color, an, al);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment