← Back to STL Containers
Question 455
Print a Set in Sorted Order
Print a Set in Sorted Order
Aset<int>namedsalready holds the values 5, 1 and 3. Write a range-based for loop that prints each element followed by a single space (the trailing space after the last value is fine; the grader ignores it). The newline after the loop is already written for you.
Expected Output:
1 3 5= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
STL ContainersSets
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.