Display from highest to lowest using arrays

Feb 19, 2014 at 9:43am
I need help of how do you output the highest to lowest(not highest and lowest) using arrays from user input. I have no idea but to use for loops and if statements. And also to put prefixes. Sample output:

Person 10: 9
Person 2: 7
Person 7: 5

Something like that, thanks in advance :)
Feb 19, 2014 at 10:01am
Hi, do you want to sort the array? Simple algorithms are the bubble sort and the insertion sort. I have examples here:

http://cppgo.wordpress.com/2014/01/29/bubble-sort-algorithm/comment-page-1/#comment-11

This is another example, the user inputs how many pancakes they're eaten, and then I sort, and output in order.

http://cppgo.wordpress.com/2014/01/29/pancake-glutton/
Feb 19, 2014 at 11:11am
Can you explain me this "bubble sort" algorithm?
Feb 19, 2014 at 12:13pm
Topic archived. No new replies allowed.