2021年2月10日星期三

Sorting Algorithm for Class

I am quite new to programming, and I have tried restlessly to figure out how to do this, but Alas I have yet to find anything. In my program, I have a struct. It is a sport sim, so the struct looks a bit like this

struct Team{    string name;  int reputation;    }  

I have over one-hundred teams declared in an array

Team team[120];

I need something to arrange these teams by their reputation, and I need the program to be able to figure out who the top four teams (based on reputation) are to put them in the playoffs.

I am still new to programming, so any help is appreciated!

https://stackoverflow.com/questions/66147788/sorting-algorithm-for-class February 11, 2021 at 10:04AM

没有评论:

发表评论