internetuser   10 #1 Posted January 23, 2011 does anyone know a way of how i could get a set of results displayed in descending order? Share this post Link to post Share on other sites Share this content via...
Fognuts   10 #2 Posted January 23, 2011 does anyone know a way of how i could get a set of results displayed in descending order?  Yeah start at the highest denominator and work down Share this post Link to post Share on other sites Share this content via...
Bulgarian   10 #3 Posted January 23, 2011 a bubble sort on the data set should do it ?  http://mathbits.com/mathbits/compsci/arrays/bubble.htm Share this post Link to post Share on other sites Share this content via...
internetuser   10 #4 Posted January 23, 2011 my program is supposed to use input numbers which are then used in a mathematical formula and give me a result, i need to do this several times, so i get several sets of results, and then i need to display these results in descending order... Share this post Link to post Share on other sites Share this content via...
Fognuts   10 #5 Posted January 23, 2011 average the numbers out then from 10 to 0 Doh ? Share this post Link to post Share on other sites Share this content via...
Bulgarian   10 #6 Posted January 23, 2011 Store the results in an array, bubble sort it, display it - done. Share this post Link to post Share on other sites Share this content via...
internetuser   10 #7 Posted January 23, 2011 average the numbers out then from 10 to 0 Doh ?  can you give me an idea of how to do this? i'm a beginner Share this post Link to post Share on other sites Share this content via...
BritPat   10 #8 Posted January 23, 2011 average the numbers out then from 10 to 0 Doh ?  If you don't want to assist just ignore the post ! Share this post Link to post Share on other sites Share this content via...
spooky3   10 #9 Posted January 23, 2011 In C++ use the stl library list and it's sort algorithm  http://www.cplusplus.com/reference/stl/list/sort/ Share this post Link to post Share on other sites Share this content via...
Bulgarian   10 #10 Posted January 23, 2011 I would have been suprised if there wasn't a sort function in C++, it's a basic requirement for most languages. Share this post Link to post Share on other sites Share this content via...
spooky3 Â Â 10 #11 Posted January 23, 2011 I would expect you've been taught IO before being asked to sort lists / arrays, but: Â http://www.cplusplus.com/doc/tutorial/basic_io/ Share this post Link to post Share on other sites Share this content via...
spooky3   10 #12 Posted January 23, 2011 Just for some light reading here's a list of sorting algorithms  http://en.wikipedia.org/wiki/Sorting_algorithm  and animated demonstrations  http://www.sorting-algorithms.com/ Share this post Link to post Share on other sites Share this content via...