Skip to content

Commit

Permalink
format output
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar002 committed Oct 26, 2014
1 parent bc100bc commit 6477df1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/pascalTriangle/pascalTriangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,25 @@ vector<vector<int> > generate(int numRows)

void printVector(vector< vector<int> > pt)
{
cout << "[" << endl;
for(int i=0; i<pt.size(); i++){
cout << "{ ";
for(int space=(pt.size()-i-1); space>=0; space--){
cout << " ";
}
cout << "[";
for(int j=0; j<pt[i].size(); j++){
cout << pt[i][j] << ", ";
cout << pt[i][j];
if(j<pt[i].size()-1){
cout << ",";
}
}
cout << "]";
if(i<pt.size()-1){
cout << ",";
}
cout << "} " << endl;
cout << endl;
}
cout << "]" << endl;
}

int main(int argc, char** argv)
Expand Down

0 comments on commit 6477df1

Please sign in to comment.