[Multi-level sorting problem] Student performance ranking & competition team standings

Item 1: Sort the scores of all students in the final exam according to the total score. If the total score is the same, then the Chinese score will be ranked from high to low. If the Chinese score is the same, the students will be similarly examined in order in mathematics, English, physics, chemistry and pinyin. The order of the letters in the alphabet.

Question 2: Rank the teams in a football match. The ranking rules are as follows:
1. Compare the points first, and the team with the higher score will be ranked first;
2. If the score is the same, the goal difference will be compared, and the team with the most goal difference will be ranked first;
3. If the points and goal difference are the same, compare the number of goals scored, and the team with the most goals will be ranked first;
4. For teams with the same points, goal difference and goal difference, according to their names in lexicographical order arrangement.
Now suppose that each team's name is composed of uppercase English letters, and there is no team with the same name.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325919956&siteId=291194637