使用选择法进行排序,代码:
#include<iostream>
using namespace std;
struct Students
{
int num;
char name[20];
char sex;
int score;
};
int main()
{
struct Students su[5]
={
{1001,"xway",'M',93},{1002,"minve",'F',49},{1003,"glove",'F',43},
{1004,"sk",'M',65},{1005,"fys",'M',86}
};
struct Students temp;
const int n=5;
int i,j,k;
cout<<"before sort:"<<endl;
for(i=0;i<......
阅读全文