求救,C语言程序设计题,谢谢~~
来源:百度知道 编辑:UC知道 时间:2024/06/03 04:58:11
⑵编写主函数,先定义Student结构数组
⑶通过排序算法将学生信息按年龄由小到大的顺序进行显示。
⑷给出某学生学号,可对该学生信息进行查找,若找到,显示该同学信息,否则显示“该学生不存在“。
//WIN-TC测试通过:
#include "stdio.h"
#include "conio.h"
#define left 75
#define right 77
#define enter 13
#define OK 1
#define ERO 0
#define DO 1
#define UN_DO 0
#define LONG_STUDENT sizeof(struct student)
struct str_head{
int longth;
struct student *l_head;
}front={0,0};
struct student{
char stud_num;
char *name;
int age;
char sex;
char *banji;
char *dianhua;
struct student *next;
}*head=0;
tianjia(){
char press_key;
struct student *stud;
if((stud=(struct student *)malloc(LONG_STUDENT))==0)
{
printf("fail!");
printf("\n");
exit(ERO);