Created
April 19, 2016 16:00
-
-
Save DiegoNaterasPonce/9db32abc7c5a68a3d7df638343650398 to your computer and use it in GitHub Desktop.
#WSQ13 Exam2 Prog1
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> | |
#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