diff --git a/3.c b/3.c new file mode 100644 index 0000000..9328655 --- /dev/null +++ b/3.c @@ -0,0 +1,78 @@ +#include +#define N 3 + +struct stu_info +{ + int num; + float math,physics,english,total,ave; +}; + +struct stu_info stu[N]; + +void sort(struct stu_info *stu) +{ + int i,j; + struct stu_info tmp; + for(i=0;iave>(stu+j+1)->ave) + { + tmp = *(stu+j); + *(stu+j) = *(stu+j+1); + *(stu+j+1) = tmp; + } + } + } + return; +} + +void input(void) +{ + int i; + for(i=0;i