(结构体)十个学生,学号姓名,年龄,成绩,按照年龄从大到小排序,输出排序后的结果

/*
分析:结构体储存学生的信息
*/
#include

#define P 10

typedef struct Student    //typedef(相当于给这个结构体类型取了个外号,你可以用这个外号做跟他真名一样能做的事情,这里的S 就是我取得外号)
{
	char xh[12];
	char name[10];
	int age;
	float score;
}S;

void Scanf(S *s);
void Print(S *s);
void MP(S *s);

int main()
{
	S s[P];
	Scanf(s); //输入
	MP(s);
	Print(s);   //输出
	return 0;
}

void Scanf(S *s)
{
	int i;
	for(i=0;i

你可能感兴趣的:(c语言,算法,开发语言)