Given a grade report for all students in a class, which includes student ID, Chinese grade, English grade, math grade, and science grade for each student. Please list the report sorted by the total grade from high to low. If the total grade is the same between two students, then sort by order of Chinese grade, English grade, math grade, science grade, and student ID, which is from high to low for all grades and from low to high for student ID.
You need to store these information in structures:
typedef struct
{
int ID;
int Chinese, English, math, science;
int total;
} Grade;
HINT
Hint: While sorting, you can use qsort in <stdlib.h> or write other sorting algorithms by your self.
function.h
main.c
The first line contains an integer N, which means the number of students in the class.
In the following N lines, there are 5 integers: student ID, Chinese grade, English grade, math grade, and science grade in each line in order, which are separate by spaces.
List the sorted report, while each line contains student ID, total grade, Chinese grade, English grade, math grade, and science grade in order, where there is a '\t' between each number. Note that there is a '\n' at the end of each line.