#include #include #define N 7 struct stu_info { int num,cls; char name[20]; float math,physics,english; }; struct stu_info stu[N]={{10001,11,"Zhang",99.5,88.5,89.5}, {10002,12,"Yang",77.9,56.5,87.5}, {10003,11,"Liang",92.5,99.0,60.5}, {10004,11,"Cai",89.6,56.9,90.5}, {10005,14,"Fu",55.6,67.9,98.9}, {10006,12,"Mao",22.1,45.9,99.2}, {10007,13,"Zhan",35.6,67.9,88.0}}; void sort(struct stu_info *stu,int n) { int i,j; struct stu_info tmp; for(i=0;icls>(stu+j+1)->cls)||((stu+j)->cls==(stu+j+1)->cls)&&((stu+j)->num>(stu+j+1)->num)) { tmp = *(stu+j); *(stu+j) = *(stu+j+1); *(stu+j+1) = tmp; } } } return; } void s_cls() { int to,from,i; scanf("%d-%d",&to,&from); for(i=0;i=lim) printf("%d %d %s %.1f %.1f %.1f\n",stu[i].num,stu[i].cls,stu[i].name,stu[i].math,stu[i].physics,stu[i].english); } } void s_cls_num() { int key,to,from,i; scanf("%d.%d-%d",&key,&to,&from); for(i=0;i