建立一个学生信息系统,输入学生信息,输出挂科同学的信息,再按照平均成绩的高低排序输出
输入样例
5
zhaoyi 70 80 90
qianer 65 32 77
sunsan 100 55 68
lisi 86 77 90
wanggu 100 59 66
输出样例
*[qianer] 65 32 77
*[sunsan] 100 55 68
*[wangwu] 100 59 66
lisi 86 77 90
zhaoyi 70 80 90
wangwu 100 59 66
sunsan 100 55 68
qianer 65 32 77
代码实现
#include<bits/stdc++.h>
using namespace std;
typedef struct{
//定义一个结构体并命名为Student
char name[20];
float score1;
float score2;
float score3;
float total;
}Student;
void swap1(Student s[], int i, int j){
//交换结构体中的数据
Student temp = s[i];
s[i] = s[j];
s[j]