用结构表示学生的学号和成绩,编写程序,对班中30名学生按成绩进行排序,并输出排序后的学号、成绩和全班平均分。
#include <stdio.h>
#include <stdlib.h>
#define STNUM 5
struct stuinf
{
int stid;
int score;
}stu [STNUM];
struct stuinf * p[STNUM]; /*p:由指向结构的指针构成的指针数组*/
int main()
{
struct stuinf * ptemp,* p[STNUM];
int i,j,sum=0;
for(i=0;
原创
2020-08-02 22:04:35 ·
2200 阅读 ·
1 评论