C语言数据库学生成绩统计管理系统技术学习

上传人:博****1 文档编号:488976740 上传时间:2024-01-12 格式:DOC 页数:14 大小:70KB
返回 下载 相关 举报
C语言数据库学生成绩统计管理系统技术学习_第1页
第1页 / 共14页
C语言数据库学生成绩统计管理系统技术学习_第2页
第2页 / 共14页
C语言数据库学生成绩统计管理系统技术学习_第3页
第3页 / 共14页
C语言数据库学生成绩统计管理系统技术学习_第4页
第4页 / 共14页
C语言数据库学生成绩统计管理系统技术学习_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《C语言数据库学生成绩统计管理系统技术学习》由会员分享,可在线阅读,更多相关《C语言数据库学生成绩统计管理系统技术学习(14页珍藏版)》请在金锄头文库上搜索。

1、学生成绩统计管理系统C语言数据结构课程作品指导老师:学生:学号:班级:一、代码#include stdafx.h#include #include #include #include #include #include #include struct grade int score; struct grade *next; /*定义成绩的结构*/struct address char stu_num4; /*学号*/ char hname10; /*性别*/ char ename20; /*姓名*/ char depart30; /*系别*/ char paddress30; /*地址*/ c

2、har phone13 /*联系电话*/; struct grade *head; struct address *next; ; void loaddata (struct address *had);void printm (struct address *head);struct address * seek (struct address *head);void revise (struct address *hp);void delate (struct address *head);void saveda (struct address *tou );void addnew (st

3、ruct address *had );void moveg (int i,struct grade *move);void gotoxy(int x,int y);void sortp(struct address *head);int main ( void ) char ch; int c; struct address *head=NULL; loaddata(&head); do system(cls); printf( n); printf(学生信息与成绩统计:n); printf( 岳鹏程制作n); printf( =n); printf( Menu: n); printf( 1

4、:print all the personal information. n); printf( 2:insert some or one person. n); printf( 3:revire some information. n); printf( 4:delate some information or a person. n); printf( 5:exit. n); printf( =n); printf(tInput :); do scanf(%d,&c); getchar( ); while(c6); switch ( c ) case 1: printm(head); br

5、eak; case 2: addnew(&head); break; case 3: revise(head); break; case 4: delate(&head); break; break; case 5: return 0; default: break; fflush(stdin); printf(continue or not: input y or nn); ch=getchar( ); saveda(head); while(ch=y|ch=Y); return 0;void loaddata (struct address *had ) FILE *afhead; FIL

6、E *gfhead; struct address *p1,*hp1=NULL,*head=NULL; struct grade *p2 , *hp2 = NULL; int i=0; int j=6; if( !(afhead = fopen(d:information.dat,rb) return; if( !(gfhead = fopen(d:grade.dat , rb) ) return; while (!feof(afhead) p1 = (struct address *)malloc(sizeof(struct address); fread(p1,sizeof(struct

7、address),1,afhead); if(feof(afhead) if(!p1) free(p1); break; if(i=0) p1-next = NULL; p1-head = NULL; head = p1; hp1 = p1; i+; /*使头指针指向第一个创建的节点*/ else p1-next = NULL; p1-head = NULL; hp1-next = p1; hp1 = hp1-next; *had = head; p1 = *had; /*成绩是后进先出*/ while (!feof(gfhead) do p2=(struct grade *)malloc(s

8、izeof(struct grade); fread(p2,sizeof(struct grade),1,gfhead); p2-next = hp2; hp2 = p2; j -; while( j 0 ); if( !feof(gfhead) & p1 != NULL) p1 - head = hp2; p1 = p1 - next; fclose(afhead); fclose(gfhead); void printm (struct address *head) int i=0 , j; float iscore; struct grade *ghd=NULL; struct address *hd=NULL; hd = head; system(cls); if (hd=NULL) printf(tt= No sourse in the file! =); return ; while (hd != NULL) gotoxy(1,i+1); printf(=n); for(j=0;jstu_num); gotoxy(30,i+2); printf(Name-spelling: %s , hd-ename ); gotoxy(5,i+3); printf(Sex:%s , hd-hname ); gotoxy(30,i+3); printf(Department: %s,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号