Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI
diff options
context:
space:
mode:
2 files changed, 36 insertions, 0 deletions
-rw-r--r--pract_SI/pract. 03/Solutions/task1.cpp19
-rw-r--r--pract_SI/pract. 03/Solutions/task2.cpp17
diff --git a/pract_SI/pract. 03/Solutions/task1.cpp b/pract_SI/pract. 03/Solutions/task1.cpp
new file mode 100644
index 0000000..ae955a8
--- /dev/null
+++ b/pract_SI/pract. 03/Solutions/task1.cpp
@@ -0,0 +1,19 @@
+#include "pch.h"
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ unsigned long long number;
+ cin >> number;
+
+ for (int i = 1; i <= number; i++)
+ {
+ for (int j = 1; j <= i; j++)
+ cout << j;
+ cout << endl;
+ }
+
+ return 0;
+}
diff --git a/pract_SI/pract. 03/Solutions/task2.cpp b/pract_SI/pract. 03/Solutions/task2.cpp
new file mode 100644
index 0000000..b3e970d
--- /dev/null
+++ b/pract_SI/pract. 03/Solutions/task2.cpp
@@ -0,0 +1,17 @@
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ unsigned long long number;
+ cin >> number;
+
+ for (unsigned long long x = 1, y = number; x < number; x++)
+ {
+ cout << "x = " << x << " "
+ << "y = " << --y << endl;
+ }
+
+ return 0;
+}