资源描述:
《学生成绩管理信息系统源码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include"dos.h"#include"stdio.h"#include"stdlib.h"#include"conio.h"#include"math.h"#include"string.h"/**********************建立链表******************************/structhj{intage;longnumber;charname[10],address[50],sex[2];structhj*next;};/**************************文件操作函数********************
2、**********/FILE*fp;voidopenfile(charxx[20]){fp=fopen(xx,"ab+");if(fp==NULL)fp=fopen(xx,"wb");}/************************录入信息函数***********************************/voidhjnew(void){system("cls");intn=0,xage;longxnumber;charxname[10];charxaddress[50];charxsex[2];structhj*head;structhj*x1,*x2
3、;head=NULL;x2=NULL;printf("★★★★★欢迎使用户籍管理系统★★★★★");printf("★★★录入信息★★★");printf("〓提示输入0返回上级菜单〓");printf("请输入学号【15字内】:");scanf("%ld",&xnumber);if(xnumber==0)gotohaha;printf("请输入姓名【10字内】:");scanf("%s",xname);printf("请输入年龄【
4、-__-
5、】:");scanf("%d",&xage);printf("请输入性别【男O
6、R女】:");scanf("%s",xsex);printf("请输入籍贯【25字内】:");scanf("%s",xaddress);while(xnumber!=0){n++;x1=(structhj*)malloc(sizeof(structhj));x1->number=xnumber;strcpy(x1->name,xname);strcpy(x1->sex,xsex);x1->age=xage;strcpy(x1->address,xaddress);if(n==1)head=x1;elsex2->next=x1;x2=x1;printf("请输入
7、学号【15字内】:");scanf("%ld",&xnumber);if(xnumber==0)break;printf("请输入姓名【10字内】:");scanf("%s",xname);printf("请输入年龄【
8、-__-
9、】:");scanf("%d",&xage);printf("请输入性别【男OR女】:");scanf("%s",xsex);printf("请输入籍贯【25字内】:");scanf("%s",xaddress);}x2->next=NULL;x1=head;while(x1!=NULL){openfile("hj.txt")
10、;chard[5]="四川";fwrite(x1,sizeof(structhj),1,fp);fclose(fp);if(strstr(x1->address,d)!=NULL){openfile("schj.txt");fwrite(x1,sizeof(structhj),1,fp);fclose(fp);}else{openfile("qthj.txt");fwrite(x1,sizeof(structhj),1,fp);fclose(fp);}x1=x1->next;}haha:;}/*****************************查询函数*****
11、********************/voidhjxmselect(void)//按学号方式查询函数{ssmmx:intn=0;longhh;system("cls");printf("★★★★★欢迎使用户籍管理系统★★★★★");printf("★★★查询编辑信息★★★");printf("〓提示输入0返回上级菜单〓");printf("请您输入学号:");scanf("%ld",&hh);if(hh!=0){structhj*p;structhj*q=NULL,*head=NULL;fp=fopen("hj.t