Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- using namespace std;
- /*
- using namespace std;
- void DibujaCuadrado(string *cuadro, int n) {
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cout << " " << *cuadro << " ";
- }
- cout << endl;
- }
- }
- int main() {
- int n;
- cout << "Ingrese un numero para calcular la dimencíón del cuadro: "; cin >> n;
- string* cuadro = new string;
- cout << "Ingrese la palabra: "; cin >> *cuadro;
- DibujaCuadrado(cuadro, n);
- _getch();
- return 0;
- }*/ // Problema 1 y 2
- void PosincionX() {
- int x;
- cout << "Ingresa la posición X: "; cin >> x;
- for (int i = 0; i < x; i++) {
- cout << " ";
- }
- }
- void PosicionY() {
- int y;
- cout << "Ingresa la posición Y: "; cin >> y;
- for (int i = 0; i < y; i++) {
- cout << endl;
- }
- }
- void DibujarCuadro(int n) {
- char *caracter = new char;
- cout << "Ingrese el carácter: "; cin >> *caracter;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cout << *caracter;
- } cout << endl;
- }
- }
- int main() {
- int n;
- cout << "Ingresla la dimesión del cuadrado: "; cin >> n;
- PosicionY();
- PosicionY();
- DibujarCuadro(n);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement