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; | |
| void findMinMax(int arr[], int size) { | |
| int minVal = arr[0], maxVal = arr[0]; | |
| int minIndex = 0, maxIndex = 0; | |
| for (int i = 1; i < size; i++) { |
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 <map> | |
| using namespace std; | |
| enum Menu { | |
| EXIT = 0, | |
| PLUS = 101, | |
| MINUS, | |
| DIVIDE, |
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 <limits> | |
| using namespace std; | |
| int max_value(int a, int b) { | |
| return (a > b) ? a : b; | |
| } | |
| int max_value(int a, int b, int c) { |
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; | |
| void shuffleArray(int arr[], int size) | |
| { | |
| for (int i = size - 1; i > 0; i--) | |
| { | |
| int j = rand() % (i + 1); | |
| int temp = arr[i]; | |
| arr[i] = arr[j]; |
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 <cmath> | |
| // 1. Функція my_increment | |
| void my_increment(int* ptr, int n = 1) { | |
| if (ptr) { | |
| *ptr += 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
| 1) | |
| #include <iostream> | |
| void calculateSumAndProduct(int* arr, int size, int* sum, int* product) { | |
| *sum = 0; | |
| *product = 1; | |
| for (int i = 0; i < size; ++i) { | |
| *sum += arr[i]; | |
| *product *= arr[i]; |
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
| 1) | |
| #include <iostream> | |
| using namespace std; | |
| double add(double a, double b) { return a + b; } | |
| double subtract(double a, double b) { return a - b; } | |
| double multiply(double a, double b) { return a * b; } | |
| double divide(double a, double b) { return b != 0 ? a / b : 0; } | |
| int main() { |
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
| 1) | |
| #include <iostream> | |
| using namespace std; | |
| int* createArray(int size) { | |
| return new int[size]; | |
| } | |
| void fillArray(int* arr, int size) { | |
| cout << "Введіть " << size << " елементів:\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 <cstring> | |
| #include <cctype> | |
| using namespace std; | |
| // Порахувати кількість цифр у рядку | |
| int countDigits(const char* str) { | |
| int count = 0; | |
| while (*str) { |
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
| 1) | |
| #include <iostream> | |
| int main() { | |
| char arr[11]; | |
| std::cout << "Введіть рядок з 10 латинських маленьких літер: "; | |
| std::cin >> arr; | |
| int length = 0; |