早教吧 育儿知识 作业答案 考试题库 百科 知识分享

谢谢您的回答可是还有一道跟它相关的题#include#includestructstudent{\x05intid;\x05intscore;};voidsort(structstudent*students,intn){/*Sortthenstudentsbasedontheirscore*//*Remember,eachstudentmustbematchedwithth

题目详情
谢谢您的回答 可是还有一道跟它相关的题
#include
#include
struct student{
\x05int id;
\x05int score;
};
void sort(struct student* students,int n){
/*Sort the n students based on their score*/
/* Remember,each student must be matched with their original score after sorting */
}
int main(){
/*Declare an integer n and assign it a value.*/
/*Allocate memory for n students using malloc.*/
/*Generate random IDs and scores for the n students,using rand().*/
/*Print the contents of the array of n students.*/
/*Pass this array along with n to the sort() function*/
/*Print the contents of the array of n students.*/
return 0;
}



















▼优质解答
答案和解析
#include #include struct student{int id;int score;};void sort(struct student* number, int n){   &nbs...