Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 03
diff options
context:
space:
mode:
Commita78a314b374e5372c3865f16bde40845db5b79a2 (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2021-10-28 10:51:13 -0400
Committer
 GitHub <noreply@github.com>
2021-10-28 10:51:13 -0400
Files2bd770818701a7e10c68969d3683fe7ca11477b4 /Sem. 03
Introduction_to_programming_FMI-a78a314b374e5372c3865f16bde40845db5b79a2.tar
Introduction_to_programming_FMI-a78a314b374e5372c3865f16bde40845db5b79a2.tar.gz
Introduction_to_programming_FMI-a78a314b374e5372c3865f16bde40845db5b79a2.zip
Parenta2988f74c6cace502805e2e124e23ca2b95bb335 (diff)
Create exercise 10.cpp
1 files changed, 25 insertions, 0 deletions
-rw-r--r--Sem. 03/solutions/exercise 10.cpp25
diff --git a/Sem. 03/solutions/exercise 10.cpp b/Sem. 03/solutions/exercise 10.cpp
new file mode 100644
index 0000000..dae43ab
--- /dev/null
+++ b/Sem. 03/solutions/exercise 10.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ int count;
+ cin >> count;
+
+ for (int i = 1; i <= count; i++)
+ {
+ for (int j = 0; j < count; j++)
+ {
+ if (j % 2 == 0)
+ {
+ cout << i + (count * j) << " ";
+ }
+ else
+ {
+ cout << (j + 1) * count - (i - 1) << " ";
+ }
+ }
+ cout << endl;
+ }
+}