Skip to content

Commit 13a729e

Browse files
authored
Update PascalTriangle
To include nice spacing at the start of series like this : 1 1 1 1 2 1
1 parent 8c32cd0 commit 13a729e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Algorithms/PascalTriangle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ void pascal(int n)
2323
{
2424
for (int i = 0; i < n; i++)
2525
{
26+
for (int j = i; j <= n; j++)
27+
{
28+
cout <<" ";
29+
}
2630
for (int j = 0; j <= i; j++)
2731
{
2832
cout << BinCoef(i, j)<<" ";
@@ -38,4 +42,4 @@ int main()
3842
cin >> rows;
3943
pascal(rows);
4044
return 0;
41-
}
45+
}

0 commit comments

Comments
 (0)