Created
March 23, 2017 22:55
-
-
Save Adals20/8c590c6d25a8534e3c7f717e87890fd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void linea(int n){ | |
int i = 0, f =0; | |
if (i<=n){ | |
for (i =0; i<= n; i++) | |
cout << "T"; | |
} | |
cout <<"\n"; | |
} | |
void piramide(int n){ | |
int f=0; | |
while (f<=n){ | |
linea (f); | |
f = f+1; | |
} | |
while (f>=0){ | |
linea (f); | |
f = f-1; | |
} | |
} | |
main(){ | |
int n; | |
cout << "Tamaño de su piramide: " ; | |
cin >> n; | |
piramide (n); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment