1
#include <iostream>
2
using namespace std;
3
4
struct DATE{
5
string name;
6
int scroe;
7
int age;
8
bool sex;
9
};
10
11
int main{
12
int n=0;
13
cout<<"學生管理系統"<<endl;
14
cout<<"請輸入學生個數:";
cin>>n;
15
DATE* stdu=new DATE[n];
16
cout<<"請輸入學生信息(姓名 成績 年齡 性別(0/1)):"
17
for(int i=0; i<n; i++){
18
cin>>stdu[i].name>>stdu[i].score>>stdu[i].age>>stdu[i].sex;
19
}
20
delete[] stdu;
21
}
#include <iostream>2
using namespace std;3

4
struct DATE{5
string name;6
int scroe;7
int age;8
bool sex;9
};10

11
int main{12
int n=0;13
cout<<"學生管理系統"<<endl;14
cout<<"請輸入學生個數:";cin>>n;
15
DATE* stdu=new DATE[n];16
cout<<"請輸入學生信息(姓名 成績 年齡 性別(0/1)):"17
for(int i=0; i<n; i++){18
cin>>stdu[i].name>>stdu[i].score>>stdu[i].age>>stdu[i].sex;19
}20
delete[] stdu;21
}問題,如何按照學生成績進行排序?



