Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void DibujaCuadrado(short* n, float* p, short* x, short* y) {
- for (short b = 1; b <= *y; b++) {
- cout << endl;
- }
- for (short i = 1; i <= *p; i++) {
- for (short a = 1; a <= *x; a++) {
- cout << " ";
- }
- for (short j = 1; j <= *p; j++) {
- cout << *n << " ";
- }
- if (*n >= 10) {
- cout << endl;
- }
- cout << endl;
- }
- }
- int main() {
- short* n = new short;
- cout << "Ingrese el numero a mostrar: ";
- cin >> *n;
- float* p = new float[*n];
- cout << "Ingrese el lado del cuadrado: ";
- cin >> *p;
- short* x = new short;
- cout << "Ingrese coordenadas x ";
- cin >> *x;
- short* y = new short;
- cout << "Ingrese coordenadas y ";
- cin >> *y;
- cout << endl;
- cout << endl;
- DibujaCuadrado(n, p, x, y);
- delete p;
- delete n;
- delete x;
- delete y;
- cout << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement