使用交换排序法,利用指针和数组对学生成绩进行升序排序

//使用交换排序法,利用指针和数组对学生成绩进行升序排序
#include 
#include  
#include 
#include 
#include 
using namespace std;
struct student 
{
	int no;
	char name[10];
	char sex;
	double score;
};

void sort(student *s[],int n)
{
	struct student *stumin;
	for (int i=0;i (*s[j]).score)
			{
				stumin = s[j];
				s[j] = s[i];
				s[i] = stumin;
			}
		}
	}
}
#define length 6
void main()
{

	struct student stu[5]={{1,"zhao",'M',87.5},{2,"qian",'M',60.8},{3,"sun",'F',96.2},{4,"li",'M',77.8},{5,"zhou",'F',37.6}};
	cout<<"使用结构体变量名:"<

你可能感兴趣的:(使用交换排序法,利用指针和数组对学生成绩进行升序排序)