C语言课程设计(教师信息管理系统)急求参考!~

来源:百度知道 编辑:UC知道 时间:2024/07/02 05:13:40
题目名称:简单的教师信息管理系统的设计
要求:
(1) 使用C语言实现,源程序要有适当的注释,使程序容易阅读
(2)系统信息应包括学号、姓名、性别、籍贯、参加工作时间、专业、学历、学位、职称、职务、奖励情况、处分情况等。
(3)系统中应具有新建、编辑、删除记录的功能。
(4)可以将部分或全部信息显示给用户。
(5)系统中可支持1-2种关键字的查询功能。
时间紧迫 ,有答案的请发到我的邮箱 jiugongli@126.com
一经采用 ,再追加100分
我还没学到数据库呢,数据库部分用一个TXT文件代替就行。

看看这个行不行:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct teacher{
char id[10];
char name[30];
char gender;
char nativeplace[30];
char beginwork[11];
char subject[50];
char qualification[20];
char degree[20];
char rank[20];
char office[30];
struct teacher *next;
};

typedef struct teacher Teacher;

Teacher *t=0;
FILE *fp;
char filename[30]="";

void free_memory(){
Teacher *n;
while(t!=0){
n=t->next;
free(t);
t=n;
}
}

void load(){
int c,fail;
Teacher *n;
printf("Do you want to load an existing file or create a new one?\n");
printf("1.Load existing one 2.Create new one\n");
scanf("%d",&c);
if(c==1){
do{
printf("Enter the name of the file: ");