Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <Windows.h>
- using namespace std;
- using namespace System;
- void dibujar_cuadrado(int ancho, int alto) {
- for (int x = 0; x < ancho; x++) {
- for (int y = 0; y < alto; y++) {
- if (x == 0 || y == 0 ||
- x == (ancho - 1) ||
- y == (alto - 1)) {
- Console::SetCursorPosition(x, y);
- cout << "*";
- }
- }
- }
- }
- int main() {
- dibujar_cuadrado(20, 10);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement