We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc100bc commit 6477df1Copy full SHA for 6477df1
src/pascalTriangle/pascalTriangle.cpp
@@ -46,13 +46,25 @@ vector<vector<int> > generate(int numRows)
46
47
void printVector(vector< vector<int> > pt)
48
{
49
+ cout << "[" << endl;
50
for(int i=0; i<pt.size(); i++){
- cout << "{ ";
51
+ for(int space=(pt.size()-i-1); space>=0; space--){
52
+ cout << " ";
53
+ }
54
+ cout << "[";
55
for(int j=0; j<pt[i].size(); j++){
- cout << pt[i][j] << ", ";
56
+ cout << pt[i][j];
57
+ if(j<pt[i].size()-1){
58
+ cout << ",";
59
60
61
+ cout << "]";
62
+ if(i<pt.size()-1){
63
64
}
- cout << "} " << endl;
65
+ cout << endl;
66
67
+ cout << "]" << endl;
68
69
70
int main(int argc, char** argv)
0 commit comments