← Back to STL Containers
Question 507
Undo History Stack
Undo History Stack
Astack<string>namedhistoryalready holds three actions pushed in this order: "type a", "type b", "delete" (so "delete" is on top). Print the top action, pop it (like an undo), then print the new top action, each on its own line. Print exactly what is shown in Expected Output.
Expected Output:
delete type b
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
STL ContainersStacks
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.