This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <iomanip> // Для гарного вирівнювання колонок (setw) | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, ""); | |
| int n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <iomanip> // Для гарного виводу матриці (setw) | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, ""); | |
| int n; | |
| cout << "Введіть розмір квадратної матриці (N): "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> // Підключення бібліотеки вектора | |
| using namespace std; | |
| int main() { | |
| setlocale(LC_ALL, ""); | |
| int n; | |
| cout << "Введіть кількість елементів: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| // Налаштування для виводу кирилиці | |
| setlocale(LC_ALL, ""); | |
| int n; | |
| cout << "Введіть розмір масиву: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <algorithm> // Для swap, якщо знадобиться | |
| using namespace std; | |
| // 1. Створення структури Worker | |
| struct Worker { | |
| string pib; // ПІБ | |
| string position; // Посада |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <list> // Підключення бібліотеки для двозв'язного списку | |
| #include <iterator> // Для роботи з ітераторами | |
| using namespace std; | |
| int main() { | |
| // 1. Створення двозв'язного списку дійсних чисел | |
| // Ініціалізуємо список набором значень для перевірки | |
| list<double> numberList = { 5.5, 15.0, 2.1, 12.5, 30.0, 18.0, 1.0, 11.0 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <forward_list> | |
| #include <iomanip> // Для setprecision | |
| using namespace std; | |
| int main() { | |
| // Створюємо список для збереження вартості товарів (тип double) | |
| forward_list<double> prices; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <forward_list> // Підключаємо бібліотеку однозв'язного списку | |
| #include <iomanip> // Для setprecision (хоча для цілих чисел не потрібно, | |
| // але є у вашому прикладі) | |
| using namespace std; | |
| int main() { | |
| // Створюємо однозв'язний список цілих чисел | |
| forward_list<int> numberList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> // Для std::cout, std::cin (ввід/вивід) | |
| #include <queue> // Для std::queue (структура "черга") | |
| #include <limits> // Для std::numeric_limits (очищення буфера) | |
| // Використовуємо стандартний простір імен | |
| using namespace std; | |
| /** | |
| * @brief Очищує потік вводу (виправляє "зламаний" cin). | |
| * Потрібно викликати ПІСЛЯ невдалого введення числа (напр., літери). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> // Для std::cout, std::cin | |
| #include <stack> // Для std::stack | |
| #include <limits> // Для std::numeric_limits (очищення буфера) | |
| #include <iomanip> // Для std::setprecision (гарний вивід) | |
| // Використовуємо стандартний простір імен | |
| using namespace std; | |
| /** | |
| * @brief Очищує потік вводу (виправляє "зламаний" cin). |
NewerOlder