Skip to content

Instantly share code, notes, and snippets.

@carlosfaria94
Created October 2, 2013 21:29
Show Gist options
  • Save carlosfaria94/6800795 to your computer and use it in GitHub Desktop.
Save carlosfaria94/6800795 to your computer and use it in GitHub Desktop.
Desenho de uma área triangular
#include <iostream>
#include <iomanip>
using namespace std;
void main() {
const int CENTER_COLUMN = 25, NUMBER_OF_ROWS = 10;
for(int row=0; row < NUMBER_OF_ROWS; ++row)
cout << setfill(' ') << setw(CENTER_COLUMN - row) << ' '
<< setfill('*') << setw(2 * row + 1) << '*' << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment