排序插入删除 c语言实现

来源:百度知道 编辑:UC知道 时间:2024/05/14 11:02:49
用C语言实现 排序 插入 删除
这是我们要做的一个项目,所以请各位高手指点一下

#include <stdio.h>
#define N 50

/*申明学员结构体*/
struct student
{
int xh; //学号
char name[20]; //姓名
int cj1; //成绩1
int cj2; //成绩2
int cj3; //成绩3
int pj; //平均成绩
};
int js; //申明全局变量计数器

/*输入函数*/
struct student st()
{
struct student stu;
printf("\n学号:");
scanf("%d",&stu.xh);
printf("\n姓名:");
fflush(stdin);
gets(stu.name);
printf("\n三门成绩:\n");
printf("成绩1:");
scanf("%d",&stu.cj1);
printf("成绩2:");
scanf("%d",&stu.cj2);
printf("成绩3:");
scanf("%d",&stu.cj3);
stu.pj=(stu.cj1+stu.cj2+stu.cj3)/3;
return stu;
}
/*输出函数*/
void sc(struct student shuchu[])
{
int i;
for (i=0;i<js;i++)
{
printf("%d\t%s\t\t%d\n",shuchu[i]