diff options
fixed styling and spacing of ex 9
1 files changed, 2 insertions, 2 deletions
| -rw-r--r-- | Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp | 4 |
diff --git a/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp b/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp index e95fa25..d1b339a 100644 --- a/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp +++ b/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp @@ -11,7 +11,7 @@ int main() for(int i = 1; i <= n; i++) { - for(int k = n - i; k >= 0; k--) + for(int k = n - i - 1; k >= 0; k--) cout << " "; // print the spaces for(int j = i; j >= 1; j--) @@ -23,7 +23,7 @@ int main() for(int i = n - 1; i >= 1; i--) { - for(int k = n - i; k >= 0; k--) + for(int k = n - i - 1; k >= 0; k--) cout << " "; for(int j = i; j >= 1; j--) |
