#include #include #include int main() { int n; // Input the number of elements std::cout << "Enter the number of elements: "; std::cin >> n; std::vector numbers(n); std::vector evens; std::vector odds; // Input the elements std::cout << "Enter the elements: "; for (int i = 0; i < n; ++i) { std::cin >> numbers[i]; } // Split numbers into evens and odds for (int num : numbers) { if (num % 2 == 0) { evens.push_back(num); } else { odds.push_back(num); } } // Sort both arrays std::sort(evens.begin(), evens.end()); std::sort(odds.begin(), odds.end()); // Output the sorted odd numbers std::cout << "Output:\n"; for (int odd : odds) { std::cout << odd; } std::cout << "\n"; // Output the sorted even numbers for (int even : evens) { std::cout << even; } std::cout << "\n"; return 0; }