If you use vector<int> then you can use std::sort() to sort the numbers.
start of loop
read a line
split line into individual integers and put into vector
call std::sort
display values
end of loop
you can do the same with simple int array instead of vector, but then you would have to write you own sort algorithm.
Ancient Dragon
Achieved Level 70
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68
We were all beginners at one time. The only way for you to learn is by coding it yourself, making mistakes, and learning how to correct your mistakes. There is a lot of self-satisfaction in knowing that you can accomplish something.
Ancient Dragon
Achieved Level 70
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68