From f51185d90bfe76d1fef272fe449c1d3d3bb89528 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 3 Nov 2021 21:15:51 +0200 Subject: Made some minor formatting and style changes to improve readability --- Sem. 03/Solutions/10. Spiral_Numbers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Sem. 03/Solutions/10. Spiral_Numbers.cpp') diff --git a/Sem. 03/Solutions/10. Spiral_Numbers.cpp b/Sem. 03/Solutions/10. Spiral_Numbers.cpp index 66e5e70..15ab136 100644 --- a/Sem. 03/Solutions/10. Spiral_Numbers.cpp +++ b/Sem. 03/Solutions/10. Spiral_Numbers.cpp @@ -10,6 +10,7 @@ int main() for (int row = 0; row < n; row++) { int previous = row + 1; + for (int col = 0; col < n; col++) { if (col == 0) @@ -17,8 +18,9 @@ int main() else if (col % 2 == 0) cout << (previous += row * 2 + 1) << " "; else - cout << (previous += (n -row -1) * 2 + 1) << " "; + cout << (previous += (n - row - 1) * 2 + 1) << " "; } + cout << endl; } } -- cgit v1.3.1-23-gd82d