Untitled
#include <iostream> #include <vector> #include <algorithm> int main() { int size; std::cin >> size; std::vector<int> arr(size); for (int i = 0; i < size; ++i) { std::cin >> arr[i]; } std::sort(arr.begin(), arr.end()); for (int i = 0; i < size; i += 2) { std::cout << arr[i] << " "; } return 0; }