Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Created May 3, 2016 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonzoibarra97/45892833919dc808c489b760c25ab312 to your computer and use it in GitHub Desktop.
Save alonzoibarra97/45892833919dc808c489b760c25ab312 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int triangles(int size){
for(int i=1; i<=size; i++)
{
for(int n=1; n<i+1;n++)
cout<<"T";
cout<<endl;
}
for(int i=size-1; i>=1; i--){
for(int n=1; n<i+1;n++)
cout<<"T";
cout<<endl;
}
}
int main(){
int tamao;
cout<< "Give the size you want for the triangle";
cin>> tamao;
triangles(tamao);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment