主题:教务管理系统C语言源代码
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <stdlib.h>
#define MAX 10
#define N 20
#define M 10
void by_name(struct CLASS *headp);
void by_number(struct CLASS *headp);
void by_age(struct CLASS *headp);
void by_tel(struct CLASS *headp);
void write_file(struct CLASS *headp,FILE *myfile);
float SUBAVE(struct CLASS *headp,int,int,int);
void CLAAVE(struct CLASS *headp);
void incredit(struct CLASS *headp);
void sort(struct CLASS *headp);
void method(void);
void WarnCLA();
void WarnSTU();
void WarnSUB();
void SUCESSES();
void out(struct CLASS *headp,int,int);
void introduce(void);
void screen(int,int,int,char *p[]);
struct CLASS * read_file(struct CLASS *headp,FILE *myfile);
struct CLASS * create(struct CLASS *headp);
struct CLASS * mod_stu(struct CLASS *headp);
struct CLASS * mod_sbj(struct CLASS *headp);
struct CLASS * mod_score(struct CLASS *headp);
struct CLASS * mod_STUkey(struct CLASS *headp);
struct CLASS * del_sbj(struct CLASS *headp);
struct CLASS * del_stu(struct CLASS *headp);
struct CLASS * del_cla(struct CLASS *headp);
struct CLASS * ins_cla(struct CLASS *headp);
struct CLASS * ins_stu(struct CLASS *headp);
struct CLASS * ins_sbj(struct CLASS *headp);
struct STUD{ /*学生结构体*/
long number;
unsigned subjects;
unsigned age;
float average;
char STUkey[12];
char name[N];
char kind[M];
char sex[M];
char bir_p[N];
char add[N];
long tel;
char mobilephone[15];
struct STUD* next;
struct SUB* first;
};
struct CLASS{ /*班级结构体*/
unsigned no;
unsigned students;
unsigned classes;
char ADMkey[12];
float score[MAX];
float average;
struct STUD* first;
struct CLASS* next;
};
struct SUB{ /*课程结构体*/
unsigned number;
char name[N];
unsigned credit;
unsigned ps_score;
unsigned tx_score;
unsigned un_score;
struct SUB* next;
};
FILE *fp;
int key0,key1,key,test,dx,dy,y,x,i; /*外部变量说明*/
char buf[30*10*2],buf1[30*2];
char *chp[ ]= {"file", /* 菜单项目*/
"search",
"insert",
"modify",
"delete",
"tongji",
"help",
"outby",
};
char * file[]={
"create",
"open ",
"save ",
"exit ",
};
char * search[]={
"by name",
"by number",
"by tel",
"by age",
};
char * insert[]={
"student",
"subject",
"class",
"Copy",
};
char * modify[]={
"student",
"subject",
"score ",
"STUkey",
};
char * delete[]={
"student",
"subject",
"class",
"xxxxxx",
};
char * tongji[]={
"SUBAVE",
"impass",
"incredit",
"output",
};
char * help[]={
"introduct",
"method",
"sort ",
"CLAAVE",
};
char * outby[]={
"Best",
"Good",
"Middle",
"Bad ",
};