#include #include "stack.h" using namespace std; void solve(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); } h = 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); solve(head); while (head) cout << char(pop(head)) << " "; cout << endl; return 0; }