int main() {int n;std::cout << "Enter the size of the vector: ";std::cin >> n;
}
// Пример// Input: 5// 3 1 4 5 2// Output: 5 4 3 1 2
int main() {
std::vector<int> vec(n);int n;
std::cout << "Enter the size of the vector: ";
std::cin >> n;
std::cout << "Enter the elements of the vector: ";
for (int i = 0; i < n; i++) {
std::cin >> vec[i];
}
std::sort(vec.begin(), vec.begin() + n/2, std::greater<int>());
std::cout << "Sorted vector: ";
for (int i = 0; i < n; i++) {
std::cout << vec[i] << " ";
}
return 0;
}
// Пример
// Input: 5
// 3 1 4 5 2
// Output: 5 4 3 1 2