// Write Program Sort the student's archive records by student ID from small to large # include <iostream. h> # define student _ num 5 # include <conio. h> struct student {int num; char name [20]; char sex; float score ;}; void displaystudentinfo (const student [], INT); void sortarray (student [], INT); int main () {student theclass [STUDENT _ num] = {110, "Zhang Ping", 'M', 45}, {120, "Li Xiaoming", 'M', 92 },{ 153, "Wang Gang", 'n', 89 },{ 456, "weishanshan", 'n ', 98 },{ 444, "wiehsfff", 'M', 99 }}; cout <"initial student information: \ n"; displaystudentinfo (theclass, student _ num ); cout <"\ nafter sorting: \ n"; sortarray (theclass, student _ num); displaystudentinfo (theclass, student _ num); getch (); Return 0 ;} void displaystudentinfo (const student studs [], int Len) {for (INT I = 0; I <Len; I ++) {cout <"num =" <studs [I]. num <"\ t"; cout <"name =" <studs [I]. name <"\ t"; cout <"Sex =" <studs [I]. sex <"\ t"; cout <"score =" <studs [I]. score <Endl ;}} void sortarray (student studs [], int Len) {int K; For (INT pass = 0; pass <len-1; pass ++) {for (INT I = pass + 1; I <Len; I ++) if (studs [pass]. score <studs [I]. score) k = I; Student hold; hold = studs [pass]; studs [pass] = studs [k]; studs [k] = hold ;}}