Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication5.cpp: archivo de proyecto principal.
- #include "stdafx.h"
- #include "iostream"
- using namespace std;
- void main()
- {
- int *n = new int;
- int *diagonal = new int;
- int *cruz = new int;
- cout << "Introduzca las filas: ";cin >> *n;
- *diagonal = (*n);
- *cruz = 0;
- //cout << "Introduzca las columnas: ";cin >> *columnas;
- for(int filas=1; filas <= *n; filas++) {
- for (int columnas=1; columnas <= *n; columnas++) {
- if (filas == 1 || filas == *n || columnas == 1 || columnas == *n || columnas == *diagonal || columnas == filas || columnas == (*n/2 + 1) || filas == (*n / 2 + 1))
- cout <<"*";
- else
- cout << " ";
- }
- cout << endl;
- (*diagonal)--;
- }
- system("pause>null");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement