CJCoding With Joseph
15free / daySign inCreate account

Print a Set in Sorted Order

A 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 — print one after the last line.

Hints2 available
Topics:
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.