Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <Windows.h>
  4. using namespace std;
  5. using namespace System;
  6. void dibujar_cuadrado(int ancho, int alto) {
  7.     for (int x = 0; x < ancho; x++) {
  8.         for (int y = 0; y < alto; y++) {
  9.             if (x == 0 || y == 0 ||
  10.                 x == (ancho - 1) ||
  11.                 y == (alto - 1)) {
  12.                     Console::SetCursorPosition(x, y);
  13.                     cout << "*";
  14.             }
  15.         }
  16.     }
  17. }
  18. int main() {
  19.     dibujar_cuadrado(20, 10);
  20.     _getch();
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement