学生成绩管理信息系统源码.docx

上传人:b****6 文档编号:16445731 上传时间:2023-07-13 格式:DOCX 页数:27 大小:19.28KB
下载 相关 举报
学生成绩管理信息系统源码.docx_第1页
第1页 / 共27页
学生成绩管理信息系统源码.docx_第2页
第2页 / 共27页
学生成绩管理信息系统源码.docx_第3页
第3页 / 共27页
学生成绩管理信息系统源码.docx_第4页
第4页 / 共27页
学生成绩管理信息系统源码.docx_第5页
第5页 / 共27页
学生成绩管理信息系统源码.docx_第6页
第6页 / 共27页
学生成绩管理信息系统源码.docx_第7页
第7页 / 共27页
学生成绩管理信息系统源码.docx_第8页
第8页 / 共27页
学生成绩管理信息系统源码.docx_第9页
第9页 / 共27页
学生成绩管理信息系统源码.docx_第10页
第10页 / 共27页
学生成绩管理信息系统源码.docx_第11页
第11页 / 共27页
学生成绩管理信息系统源码.docx_第12页
第12页 / 共27页
学生成绩管理信息系统源码.docx_第13页
第13页 / 共27页
学生成绩管理信息系统源码.docx_第14页
第14页 / 共27页
学生成绩管理信息系统源码.docx_第15页
第15页 / 共27页
学生成绩管理信息系统源码.docx_第16页
第16页 / 共27页
学生成绩管理信息系统源码.docx_第17页
第17页 / 共27页
学生成绩管理信息系统源码.docx_第18页
第18页 / 共27页
学生成绩管理信息系统源码.docx_第19页
第19页 / 共27页
学生成绩管理信息系统源码.docx_第20页
第20页 / 共27页
亲,该文档总共27页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

学生成绩管理信息系统源码.docx

《学生成绩管理信息系统源码.docx》由会员分享,可在线阅读,更多相关《学生成绩管理信息系统源码.docx(27页珍藏版)》请在冰点文库上搜索。

学生成绩管理信息系统源码.docx

学生成绩管理信息系统源码

#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;

};

/**************************文件操作函数******************************/

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;

head=NULL;

x2=NULL;

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★录入信息★★★\n");

printf("\n〓提示输入0返回上级菜单〓\n\n\n");

printf("\n请输入学号【15字内】:

");

scanf("%ld",&xnumber);

if(xnumber==0)

gotohaha;

printf("\n请输入姓名【10字内】:

");

scanf("%s",xname);

printf("\n请输入年龄【|-__-|】:

");

scanf("%d",&xage);

printf("\n请输入性别【男OR女】:

");

scanf("%s",xsex);

printf("\n请输入籍贯【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;

else

x2->next=x1;

x2=x1;

printf("\n请输入学号【15字内】:

");

scanf("%ld",&xnumber);

if(xnumber==0)

break;

printf("\n请输入姓名【10字内】:

");

scanf("%s",xname);

printf("\n请输入年龄【|-__-|】:

");

scanf("%d",&xage);

printf("\n请输入性别【男OR女】:

");

scanf("%s",xsex);

printf("\n请输入籍贯【25字内】:

");

scanf("%s",xaddress);

}

x2->next=NULL;

x1=head;

while(x1!

=NULL)

{

openfile("hj.txt");

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:

;

}

/*****************************查询函数*************************/

voidhjxmselect(void)//按学号方式查询函数

{

ssmmx:

intn=0;

longhh;

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★查询编辑信息★★★\n");

printf("\n〓提示输入0返回上级菜单〓\n\n\n");

printf("请您输入学号:

");

scanf("%ld",&hh);

if(hh!

=0)

{

structhj*p;

structhj*q=NULL,*head=NULL;

fp=fopen("hj.txt","rb");

if(fp==NULL)

{

printf("\n没有记录,请输入记录然后再查询!

");

getch();

gotojjx;

}

while(!

feof(fp))

{

n++;

p=(structhj*)malloc(sizeof(structhj));

fread(p,sizeof(structhj),1,fp);

if(n==1)

head=p;

else

q->next=p;

q=p;

}

q->next=NULL;

p=head;

while(p!

=NULL)

{

if(p->number==hh)

{

inta;

printf("\n结果→学号=%ld姓名=%s年龄=%d性别=%s",p->number,p->name,p->age,p->sex);

printf("\n地址=%s",p->address);

printf("\n\n操作→⑴更改数据⑵删除数据⑶查询其他数据⑷返回上页⑸退出程序\n\n请您选择操作:

");

ssmx:

scanf("%d",&a);

switch(a)

{

voidhjedit(structhj*headd,structhj*pp);

voidhjdelete(structhj*headdd,structhj*ss);

case1:

hjedit(head,p);

gotossmmx;break;

case2:

hjdelete(head,p);

gotossmmx;break;

case3:

gotossmmx;

case4:

gotojjx;

case5:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotossmx;

}

}

else

p=p->next;

}

intiiii=0;

printf("\n没有此记录1.重新查询2.返回上一页3.退出程序!

");

printf("\n请选择:

");

qqqq:

scanf("%d",&iiii);

switch(iiii)

{

case1:

gotossmmx;

case2:

gotojjx;

case3:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotoqqqq;

}

gotojjx;

}

jjx:

;

}

voidhjxhselect(void)//按姓名方式查询函数

{

ssmm:

intn=0;

charhh[10];

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★查询编辑信息★★★\n");

printf("\n〓提示输入0返回上级菜单〓\n\n\n");

printf("请您输入姓名:

");

scanf("%s",hh);

if(strcmp(hh,"0")!

=0)

{

structhj*p;

structhj*q=NULL,*head=NULL;

fp=fopen("hj.txt","rb");

if(fp==NULL)

{

printf("\n没有记录,请输入记录然后再查询!

");

getch();

gotojjj;

}

while(!

feof(fp))

{

n++;

p=(structhj*)malloc(sizeof(structhj));

fread(p,sizeof(structhj),1,fp);

if(n==1)

head=p;

else

q->next=p;

q=p;

}

q->next=NULL;

p=head;

while(p!

=NULL)

{

if(strcmp(p->name,hh)==0)

{

inta;

printf("\n结果→学号=%ld姓名=%s年龄=%d性别=%s",p->number,p->name,p->age,p->sex);

printf("\n地址=%s",p->address);

printf("\n\n操作→⑴更改数据⑵删除数据⑶查询其他数据⑷返回上页⑸退出程序\n\n请您选择操作:

");

ssm:

scanf("%d",&a);

switch(a)

{

voidhjedit(structhj*headd,structhj*pp);

voidhjdelete(structhj*headdd,structhj*ss);

case1:

hjedit(head,p);

gotossmm;break;

case2:

hjdelete(head,p);

gotossmm;break;

case3:

gotossmm;

case4:

gotojjj;

case5:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotossm;

}

}

else

p=p->next;

}

intiii=0;

printf("\n没有此记录1.重新查询2.返回上一页3.退出程序!

");

printf("\n请选择:

");

qqq:

scanf("%d",&iii);

switch(iii)

{

case1:

gotossmm;

case2:

gotojjj;

case3:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotoqqq;

}

gotojjj;

}

jjj:

;

}

voidhjjgselect(void)//按籍贯方式查询

{

yyy:

inti;

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★籍贯方式查询信息★★★\n\n\n");

printf("\n一显示所有信息\n");

printf("\n二显示四川籍所有信息\n");

printf("\n三显示其它籍所有信息\n");

printf("\n四自定义查询信息\n");

printf("\n五←返回上级菜单\n");

printf("\n六↓退出程序\n");

printf("\n\n请选择:

");

scanf("%d",&i);

switch(i)

{voidzdyselect(void);

voidallselect(chara[8]);

case1:

allselect("hj.txt");

gotoyyy;break;

case2:

allselect("schj.txt");

gotoyyy;break;

case3:

allselect("qthj.txt");

gotoyyy;break;

case4:

zdyselect();

case5:

break;

case6:

exit(0);

}

}

voidzdyselect(void)

{

ssmmz:

intn=0,j=0;

charhh[10];

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★自定义查询信息★★★\n\n\n");

printf("请您输入地址关键字:

");

scanf("%s",hh);

if(strcmp(hh,"0")!

=0)

{

structhj*p;

structhj*q=NULL,*head=NULL;

fp=fopen("hj.txt","rb");

if(fp==NULL)

{

printf("\n没有记录,请输入记录然后再查询!

");

getch();

gotojjz;

}

while(!

feof(fp))

{

n++;

p=(structhj*)malloc(sizeof(structhj));

fread(p,sizeof(structhj),1,fp);

if(n==1)

head=p;

else

q->next=p;

q=p;

}

q->next=NULL;

p=head;

while(p!

=NULL)

{

if(strstr(p->address,hh)!

=NULL)

{

inta;

j++;

printf("\n结果→学号=%ld姓名=%s年龄=%d性别=%s",p->number,p->name,p->age,p->sex);

printf("\n地址=%s",p->address);

printf("\n\n操作→⑴更改数据⑵删除数据⑶查询下一条数据⑷返回上页⑸退出程序\n\n请您选择操作:

");

ssmz:

scanf("%d",&a);

switch(a)

{

voidhjedit(structhj*headd,structhj*pp);

voidhjdelete(structhj*headdd,structhj*ss);

case1:

hjedit(head,p);

gotossmmz;break;

case2:

hjdelete(head,p);

gotossmmz;break;

case3:

p=p->next;continue;

case4:

gotojjz;

case5:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotossmz;

}

p=p->next;

}

else

p=p->next;

}

if(j==0)

{

printf("\n\n\n没有匹配的记录按任意键继续!

");

getch();

fclose(fp);

gotossmmz;

}

else

{intxx;

printf("\n\n查询完毕!

⑴继续查询⑵返回上一级菜单⑶退出程序");

printf("\n请选择:

");

scanf("%d",&xx);

if(xx==2)

gotojjz;

elseif(xx==3)

exit(0);

}

gotossmmz;

jjz:

;

}

}

voidallselect(chara[8])//全部查询

{

intn=0;

intk=0;

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★籍贯方式信息★★★\n\n\n");

structhj*p;

structhj*q=NULL,*head=NULL;

fp=fopen(a,"rb");

if(fp==NULL)

{

printf("\n对不起,没有记录无法查询!

");

gotoxxxx;

}

rewind(fp);

while(!

feof(fp))

{

n++;

p=(structhj*)malloc(sizeof(structhj));

fread(p,sizeof(structhj),1,fp);

if(n==1)

head=p;

else

q->next=p;

q=p;

}

q->next=NULL;

structhj*h1,*p2,*q3,*r4,*s5;

h1=p2=(hj*)malloc(sizeof(structhj));

p2->next=head;

while(p2->next!

=NULL)

{

q3=p2->next;

r4=p2;

while(q3->next!

=NULL)

{

if(q3->next->numbernext->number)

r4=q3;

q3=q3->next;

}

if(r4!

=p2)

{

s5=r4->next;

r4->next=s5->next;

s5->next=p2->next;

p2->next=s5;

}

p2=p2->next;

}

head=h1->next->next;

free(h1);

p=head;

while(p!

=NULL&&n>0)

{

n--;

printf("\n学号=%ld姓名=%s年龄=%d性别=%s",p->number,p->name,p->age,p->sex);

printf("\n地址=%s",p->address);

p=p->next;

}

xxxx:

printf("\n→显示完毕←\n⑴↑返回上级菜单⑵↓退出程序\n请选择:

");

xxx:

scanf("%d",&n);

switch(n)

{

case1:

break;

case2:

exit(0);

default:

printf("\n错误的选择,请重新选择:

");

gotoxxx;

}

}

voidhjselect(void)//查询编辑信息函数

{

cxbegin:

inta;

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★查询编辑信息★★★\n\n\n");

printf("\n一按学号方式查询\n");

printf("\n二按姓名方式查询\n");

printf("\n三按籍贯方式查询\n");

printf("\n四→显示全部信息\n");

printf("\n五←返回上级菜单\n");

printf("\n请选择查询方式:

");

cxmm:

scanf("%d",&a);

switch(a)

{

case1:

hjxmselect();gotocxbegin;break;

case2:

hjxhselect();gotocxbegin;break;

case3:

hjjgselect();gotocxbegin;break;

case4:

allselect("hj.txt");gotocxbegin;break;

case5:

break;

default:

printf("\n错误的选择,请重新选择:

");

gotocxmm;

}

}

voidhjde(void)//删除函数界面

{

cxxbegin:

inta;

system("cls");

printf("\n★★★★★欢迎使用户籍管理系统★★★★★\n");

printf("\n★★★删除信息★★★\n\n\n");

printf("\n一按学号方式删除\n");

printf("\n二按姓名方式删除\n");

printf("\n三按籍贯方式删除\n");

printf("\n四→删除全部信息\n");

printf("\n五←返回上级菜单\n");

printf("\n请选择删除方式:

");

cxxmm:

scanf("%d",&a);

inti=0;

switch(a)

{

case1:

hjxmselect();gotocxxbegin;break;

case2:

hjxhselect();gotocxxbegin;break;

case3:

zdyselect();gotocxxbegin;break;

case4:

fp=fopen("hj.txt","wb");

if(fp!

=NULL)

i++;

fp=fopen("schj.txt","wb");

if(fp!

=NULL)

i++;

fp=fopen("qthj.txt","wb");

if(fp!

=NULL)

i++;

if(i==3)

{

printf("\n全部数据已经删除!

!

!

!

!

!

敲任意键继续");

getch();

}

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2