

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include
else break; } aux_stack.push(i); break; case '': case '/': case '%': while (true) { if (aux_stack.top() == '(' || aux_stack.top() == '+' || aux_stack.top() == '-') break; else { output.push_back(aux_stack.top()); aux_stack.pop(); } } aux_stack.push(i); break; case '^': case '(': aux_stack.push(i); break; case ')': while (true) { if (aux_stack.top() == '(') { aux_stack.pop(); break; } else { output.push_back(aux_stack.top()); aux_stack.pop(); } } break; default: output.push_back(*i); break; } } } }