Print a Set in Sorted Order
easyQuestion 455A set<int> named s already 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, so 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.