Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit9d1770ff8d52a99a68c414a5030366a2aec3c3a1 (patch)
Author
 Стоян Златев <47269030+Tony5768@users.noreply.github.com>
2021-10-28 17:02:43 +0300
Committer
 GitHub <noreply@github.com>
2021-10-28 17:02:43 +0300
Filesf3237254a0e912dddf8aa046a963447421759597
Introduction_to_programming_FMI-9d1770ff8d52a99a68c414a5030366a2aec3c3a1.tar
Introduction_to_programming_FMI-9d1770ff8d52a99a68c414a5030366a2aec3c3a1.tar.gz
Introduction_to_programming_FMI-9d1770ff8d52a99a68c414a5030366a2aec3c3a1.zip
Parent37407ad35d0c5e19a69d4154d54be2f14450474b (diff)
Create example 10 - matrix
1 files changed, 25 insertions, 0 deletions
-rw-r--r--Sem. 03/example 10 - matrix25
diff --git a/Sem. 03/example 10 - matrix b/Sem. 03/example 10 - matrix
new file mode 100644
index 0000000..dae43ab
--- /dev/null
+++ b/Sem. 03/example 10 - matrix
@@ -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;
+ }
+}