diff --git a/学籍管理系统 步骤3.c b/学籍管理系统 步骤3.c new file mode 100644 index 0000000..5fb6658 --- /dev/null +++ b/学籍管理系统 步骤3.c @@ -0,0 +1,78 @@ +#include +#define N 3 + +struct stu_info +{ + int num; + float math,physics,english,sum,average; +}; + +struct stu_info stu[N]; + +void sort(struct stu_info *stu) +{ + int i,j; + struct stu_info tmp; + for(i=0;iaverage>(stu+j+1)->average) + { + tmp = *(stu+j); + *(stu+j) = *(stu+j+1); + *(stu+j+1) = tmp; + } + } + } + return; +} + +void input(void) +{ + int i; + for(i=0;i