[Partial Judge]
Given a ranking report for smart phones, which includes Name, Price, Score and Size for each phone.
Please print out the report sorted in descending or ascending order.
2. If the order is ascending, sort the list by Price in ascending order.
Your mission is to implement the function "sortPhone(...)" .
If you want to implement extra comapre function , please upload your code in this form:
#include "function.h"
void compare_fun1(.....){
}
void compare_fun2(.....){
}
void sortPhone(Phone *PhoneList, int n, char *order){
....................
}
Note that you have to choose "C" compiler .
The first line contains an integer N and a string, which means the number of phones and the order which data are sorting in respectively.
Input has N lines.
Each line contains 1 string, 1 integer and 2 double,representing phone Name, Price, Score and Size , which are separate by spaces.
List the sorted report, while each line contains phone Name, Price, Score and Size in order, where there is a empty space '\t' between each data.
Note that there is a '\n' at the end of each line.