Skip to content

Instantly share code, notes, and snippets.

@DiegoNaterasPonce
Created April 19, 2016 16:00
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 DiegoNaterasPonce/9db32abc7c5a68a3d7df638343650398 to your computer and use it in GitHub Desktop.
Save DiegoNaterasPonce/9db32abc7c5a68a3d7df638343650398 to your computer and use it in GitHub Desktop.
#WSQ13 Exam2 Prog1
#include <iostream>
#include <iomanip>
using namespace std;
void line_print(int x)
{
for(int i=0;i<x;i++)
cout<<"T";
}
void Triangle(int x)
{
for(int i=1;i<=x;i++)
{
line_print(i);
cout<<endl;
}
for(int i=x;i>=1;i--)
{
line_print(i);
cout<<endl;
}
}
int main() {
int x;
cout<<"Give me the maximum length of the triangle: ";
cin>> x;
Triangle(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment