#include #include "stack.h" using namespace std; stack *result(stack *&h) { stack *tmp = NULL; stack *res = NULL; while (h) { int c; c = pop(h); if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') push(tmp, c); else push(res, c); } reverse(res); while (tmp) { int elem; elem = pop(tmp); push(res, elem); } return res; } int main() { int n; cout << "n = "; cin >> n; stack *head = NULL; char x; for (int i = 0; i < n; i++) { cin >> x; push(head, int(x)); } reverse(head); stack *res = result(head); while (res) cout << char(pop(res)) << " "; cout << endl; return 0; }