diff options
30 files changed, 83 insertions, 3 deletions
| -rw-r--r-- | Sem. 03/README.md | 4 | ||||
| -rw-r--r-- | Sem. 03/example 10 - matrix | 25 | ||||
| -rw-r--r-- | Sem. 03/solutions/exercise 8 - dollar pyramid.cpp | 19 | ||||
| -rw-r--r-- | Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp | 36 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Solutions/task1.cpp (renamed from pract_SI/pract. 01/task1.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Solutions/task2.cpp (renamed from pract_SI/pract. 01/task2.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Solutions/task3.cpp (renamed from pract_SI/pract. 01/task3.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Solutions/task4.cpp (renamed from pract_SI/pract. 01/task4.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Solutions/task5.cpp (renamed from pract_SI/pract. 01/task5.cpp) | 2 | ||||
| -rw-r--r-- | pract_SI/Pract. 01/Tasks_1.txt (renamed from pract_SI/pract. 01/Tasks_1.txt) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task1.cpp (renamed from pract_SI/pract. 02/task1.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task2.cpp (renamed from pract_SI/pract. 02/task2.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task3 - no EPSILON.cpp (renamed from pract_SI/pract. 02/task3 - no EPSILON.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task3 - with EPSILON.cpp (renamed from pract_SI/pract. 02/task3 - with EPSILON.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task4.cpp (renamed from pract_SI/pract. 02/task4.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task5.cpp (renamed from pract_SI/pract. 02/task5.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task6.cpp (renamed from pract_SI/pract. 02/task6.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Solutions/task7.cpp (renamed from pract_SI/pract. 02/task7.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 02/Tasks_2.txt (renamed from pract_SI/pract. 02/Tasks_2.txt) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task1.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task1.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task2.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task2.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task3.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task3.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task4.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task4.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task5.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task5.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task6.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task6.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task7.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task7.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task8.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task8.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Solutions/task9.cpp (renamed from pract_SI/Pract. 03-04/Solutions/task9.cpp) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Startup_tasks.txt (renamed from pract_SI/Pract. 03-04/Startup_tasks.txt) | 0 | ||||
| -rw-r--r-- | pract_SI/Pract. 03/Tasks3.txt (renamed from pract_SI/Pract. 03-04/Tasks3.txt) | 0 |
diff --git a/Sem. 03/README.md b/Sem. 03/README.md index 427d736..af93bf2 100644 --- a/Sem. 03/README.md +++ b/Sem. 03/README.md @@ -67,9 +67,9 @@ do **Задача 2:** Да се напише програма, която приема 2 числа. Да се отпечатат всички общи делители сортиран наобратно. -*Вход: 28 21, Изход: 7 3 1* +*Вход: 28 21, Изход: 7 1* -*Вход: 60 30 Изход: 30 15 10 5 3 1* +*Вход: 60 30 Изход: 30 15 10 6 5 3 2 1* *Вход: 5 4 3 0 Изход: 12* 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; + } +} diff --git a/Sem. 03/solutions/exercise 8 - dollar pyramid.cpp b/Sem. 03/solutions/exercise 8 - dollar pyramid.cpp new file mode 100644 index 0000000..65f6106 --- /dev/null +++ b/Sem. 03/solutions/exercise 8 - dollar pyramid.cpp @@ -0,0 +1,19 @@ +#include <iostream> +using namespace std; + +int main() +{ + + int n; + cin >> n; + + for(int i = 1; i <= n; i++) + { + for(int j = 1; j <= i; j++) + cout << "$" << " "; // print as many dollars as the number of the current row + + cout << endl; + } + + return 0; +}
\ No newline at end of file diff --git a/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp b/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp new file mode 100644 index 0000000..d1b339a --- /dev/null +++ b/Sem. 03/solutions/exercise 9 - rightmost pyramid.cpp @@ -0,0 +1,36 @@ +#include <iostream> +using namespace std; + +int main() +{ + + int n; + cin >> n; + + // print the first part of the pyramid (the one going from 1 to n(n-1)...21) + + for(int i = 1; i <= n; i++) + { + for(int k = n - i - 1; k >= 0; k--) + cout << " "; // print the spaces + + for(int j = i; j >= 1; j--) + cout << j; // print numbers j(j - 1)...21 + + cout << endl; + } + // print the second part of the pyramid (the one going from (n-1)...21 to 1 + + for(int i = n - 1; i >= 1; i--) + { + for(int k = n - i - 1; k >= 0; k--) + cout << " "; + + for(int j = i; j >= 1; j--) + cout << j; + + cout << endl; + } + + return 0; +}
\ No newline at end of file diff --git a/pract_SI/pract. 01/task1.cpp b/pract_SI/Pract. 01/Solutions/task1.cpp index 54a1902..54a1902 100644 --- a/pract_SI/pract. 01/task1.cpp +++ b/pract_SI/Pract. 01/Solutions/task1.cpp diff --git a/pract_SI/pract. 01/task2.cpp b/pract_SI/Pract. 01/Solutions/task2.cpp index 554653d..554653d 100644 --- a/pract_SI/pract. 01/task2.cpp +++ b/pract_SI/Pract. 01/Solutions/task2.cpp diff --git a/pract_SI/pract. 01/task3.cpp b/pract_SI/Pract. 01/Solutions/task3.cpp index 830348b..830348b 100644 --- a/pract_SI/pract. 01/task3.cpp +++ b/pract_SI/Pract. 01/Solutions/task3.cpp diff --git a/pract_SI/pract. 01/task4.cpp b/pract_SI/Pract. 01/Solutions/task4.cpp index b4829b4..b4829b4 100644 --- a/pract_SI/pract. 01/task4.cpp +++ b/pract_SI/Pract. 01/Solutions/task4.cpp diff --git a/pract_SI/pract. 01/task5.cpp b/pract_SI/Pract. 01/Solutions/task5.cpp index 576bf2e..931178d 100644 --- a/pract_SI/pract. 01/task5.cpp +++ b/pract_SI/Pract. 01/Solutions/task5.cpp @@ -4,7 +4,7 @@ using namespace std; int main() { - string card_number;; + string card_number; cout << "Card number: "; cin >> card_number; diff --git a/pract_SI/pract. 01/Tasks_1.txt b/pract_SI/Pract. 01/Tasks_1.txt index bb7ee2d..bb7ee2d 100644 --- a/pract_SI/pract. 01/Tasks_1.txt +++ b/pract_SI/Pract. 01/Tasks_1.txt diff --git a/pract_SI/pract. 02/task1.cpp b/pract_SI/Pract. 02/Solutions/task1.cpp index 3a60fad..3a60fad 100644 --- a/pract_SI/pract. 02/task1.cpp +++ b/pract_SI/Pract. 02/Solutions/task1.cpp diff --git a/pract_SI/pract. 02/task2.cpp b/pract_SI/Pract. 02/Solutions/task2.cpp index a1ddcf8..a1ddcf8 100644 --- a/pract_SI/pract. 02/task2.cpp +++ b/pract_SI/Pract. 02/Solutions/task2.cpp diff --git a/pract_SI/pract. 02/task3 - no EPSILON.cpp b/pract_SI/Pract. 02/Solutions/task3 - no EPSILON.cpp index 6c9f832..6c9f832 100644 --- a/pract_SI/pract. 02/task3 - no EPSILON.cpp +++ b/pract_SI/Pract. 02/Solutions/task3 - no EPSILON.cpp diff --git a/pract_SI/pract. 02/task3 - with EPSILON.cpp b/pract_SI/Pract. 02/Solutions/task3 - with EPSILON.cpp index dcd5f88..dcd5f88 100644 --- a/pract_SI/pract. 02/task3 - with EPSILON.cpp +++ b/pract_SI/Pract. 02/Solutions/task3 - with EPSILON.cpp diff --git a/pract_SI/pract. 02/task4.cpp b/pract_SI/Pract. 02/Solutions/task4.cpp index acb471c..acb471c 100644 --- a/pract_SI/pract. 02/task4.cpp +++ b/pract_SI/Pract. 02/Solutions/task4.cpp diff --git a/pract_SI/pract. 02/task5.cpp b/pract_SI/Pract. 02/Solutions/task5.cpp index 419d6d4..419d6d4 100644 --- a/pract_SI/pract. 02/task5.cpp +++ b/pract_SI/Pract. 02/Solutions/task5.cpp diff --git a/pract_SI/pract. 02/task6.cpp b/pract_SI/Pract. 02/Solutions/task6.cpp index a7484b2..a7484b2 100644 --- a/pract_SI/pract. 02/task6.cpp +++ b/pract_SI/Pract. 02/Solutions/task6.cpp diff --git a/pract_SI/pract. 02/task7.cpp b/pract_SI/Pract. 02/Solutions/task7.cpp index 3c22a83..3c22a83 100644 --- a/pract_SI/pract. 02/task7.cpp +++ b/pract_SI/Pract. 02/Solutions/task7.cpp diff --git a/pract_SI/pract. 02/Tasks_2.txt b/pract_SI/Pract. 02/Tasks_2.txt index a419241..a419241 100644 --- a/pract_SI/pract. 02/Tasks_2.txt +++ b/pract_SI/Pract. 02/Tasks_2.txt diff --git a/pract_SI/Pract. 03-04/Solutions/task1.cpp b/pract_SI/Pract. 03/Solutions/task1.cpp index ae955a8..ae955a8 100644 --- a/pract_SI/Pract. 03-04/Solutions/task1.cpp +++ b/pract_SI/Pract. 03/Solutions/task1.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task2.cpp b/pract_SI/Pract. 03/Solutions/task2.cpp index b3e970d..b3e970d 100644 --- a/pract_SI/Pract. 03-04/Solutions/task2.cpp +++ b/pract_SI/Pract. 03/Solutions/task2.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task3.cpp b/pract_SI/Pract. 03/Solutions/task3.cpp index a6a6362..a6a6362 100644 --- a/pract_SI/Pract. 03-04/Solutions/task3.cpp +++ b/pract_SI/Pract. 03/Solutions/task3.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task4.cpp b/pract_SI/Pract. 03/Solutions/task4.cpp index 622b8a1..622b8a1 100644 --- a/pract_SI/Pract. 03-04/Solutions/task4.cpp +++ b/pract_SI/Pract. 03/Solutions/task4.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task5.cpp b/pract_SI/Pract. 03/Solutions/task5.cpp index d6ac57c..d6ac57c 100644 --- a/pract_SI/Pract. 03-04/Solutions/task5.cpp +++ b/pract_SI/Pract. 03/Solutions/task5.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task6.cpp b/pract_SI/Pract. 03/Solutions/task6.cpp index 8d0beac..8d0beac 100644 --- a/pract_SI/Pract. 03-04/Solutions/task6.cpp +++ b/pract_SI/Pract. 03/Solutions/task6.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task7.cpp b/pract_SI/Pract. 03/Solutions/task7.cpp index aa9194b..aa9194b 100644 --- a/pract_SI/Pract. 03-04/Solutions/task7.cpp +++ b/pract_SI/Pract. 03/Solutions/task7.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task8.cpp b/pract_SI/Pract. 03/Solutions/task8.cpp index 3f32ebf..3f32ebf 100644 --- a/pract_SI/Pract. 03-04/Solutions/task8.cpp +++ b/pract_SI/Pract. 03/Solutions/task8.cpp diff --git a/pract_SI/Pract. 03-04/Solutions/task9.cpp b/pract_SI/Pract. 03/Solutions/task9.cpp index 9f1f054..9f1f054 100644 --- a/pract_SI/Pract. 03-04/Solutions/task9.cpp +++ b/pract_SI/Pract. 03/Solutions/task9.cpp diff --git a/pract_SI/Pract. 03-04/Startup_tasks.txt b/pract_SI/Pract. 03/Startup_tasks.txt index 8ee6d58..8ee6d58 100644 --- a/pract_SI/Pract. 03-04/Startup_tasks.txt +++ b/pract_SI/Pract. 03/Startup_tasks.txt diff --git a/pract_SI/Pract. 03-04/Tasks3.txt b/pract_SI/Pract. 03/Tasks3.txt index 64c5c4c..64c5c4c 100644 --- a/pract_SI/Pract. 03-04/Tasks3.txt +++ b/pract_SI/Pract. 03/Tasks3.txt |
