回 帖 发 新 帖 刷新版面

主题:教务管理系统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  ",
};

回复列表 (共57个回复)

51 楼

这么夸张,都要学几年才能写出来

52 楼

呵呵,代码中缺少注释啊,希望大家不要笑话啊,当时也是初学,一边学一边做的。当时大一,暑假刚刚学C语言编程,当时不知道指针是什么,写个求n!的函数都不会,不知道怎么硬着头皮就把这个写出来了。但是不知道软件工程的规范啊!所以代码结构比较乱!

53 楼

强!收藏之

54 楼


强!收藏之!

55 楼

楼主可以传给我吗?? 我的邮箱306805699@qq.com。。

56 楼

呵呵,在程序中使用goto语句是一个不好的习惯,这样破坏了程序的结构。呵呵,不过程序思路还是很好的。

57 楼

牛啊 还没看 等有时间 一定看看

我来回复

您尚未登录,请登录后再回复。点此登录或注册