学生籍贯管理系统_学生籍贯信息管理系统

其他范文 时间:2020-02-28 03:52:22 收藏本文下载本文
【www.daodoc.com - 其他范文】

学生籍贯管理系统由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“学生籍贯信息管理系统”。

#include “stdafx.h” #include “stdio.h” #include “stdlib.h” #include “conio.h” #include “math.h” #include “string.h”

/**********************建立链表******************************/ struct hj

{

};int age;long number;char name[10],addre[50],sex[2];struct hj *next;/**************************文件操作函数******************************/ FILE *fp;void openfile(char xx[20]){ fp=fopen(xx,“ab+”);if(fp==NULL)fp=fopen(xx,“wb”);} /************************录入信息函数***********************************/ void hjnew(void){

system(“cls”);int n=0,xage;long xnumber;char xname[10];char xaddre[50];char xsex[2];struct hj *head;struct hj *x1,*x2;head=NULL;x2=NULL;printf(“n

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

★★★录入信息★★★n”);printf(“n

〒提示输入0返回上级菜单〒nnn”);printf(“n

请输入学号【15字内】:”);scanf(“%ld”,&xnumber);if(xnumber==0)goto haha;printf(“n

请输入姓名【10字内】:”);scanf(“%s”,xname);printf(“n

请输入年龄【|-__-|】:”);scanf(“%d”,&xage);printf(“n

请输入性别【男OR女】:”);

scanf(“%s”,xsex);printf(“n

请输入籍贯【25字内】:”);

scanf(“%s”,xaddre);{

while(xnumber!=0)n++;x1=(struct hj *)malloc(sizeof(struct hj));x1->number=xnumber;strcpy(x1->name,xname);strcpy(x1->sex,xsex);x1->age=xage;strcpy(x1->addre,xaddre);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”,xaddre);}

x2->next=NULL;

x1=head;

while(x1!=NULL)

{ openfile(“hj.txt”);

char d[5]=“四川”;

fwrite(x1,sizeof(struct hj),1,fp);

fclose(fp);

if(strstr(x1->addre,d)!=NULL)

{

openfile(“schj.txt”);

fwrite(x1,sizeof(struct hj),1,fp);

fclose(fp);

}

else

{

openfile(“qthj.txt”);

fwrite(x1,sizeof(struct hj),1,fp);

fclose(fp);}

x1=x1->next;}

haha:;}

/*****************************查询函数*************************/ void hjxmselect(void)//按学号方式查询函数 { mmx:

int n=0;

long hh;

system(“cls”);

printf(“n

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

★★★查询编辑信息★★★n”);printf(“n

〒提示输入0返回上级菜单〒nnn”);printf(“

请您输入学号:”);

scanf(“%ld”,&hh);

if(hh!=0)

{

struct hj *p;

struct hj *q=NULL,*head=NULL;

fp=fopen(“hj.txt”,“rb”);

if(fp==NULL){ printf(“n没有记录,请输入记录然后再查询!”);

getch();

goto jjx;}

while(!feof(fp))

{ n++;

p=(struct hj *)malloc(sizeof(struct hj));

fread(p,sizeof(struct hj),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){ int a;

printf(“n 结 果 →

学号=%ld

姓名=%s

年龄=%d

性别=%s ”,p->number,p->name,p->age,p->sex);

printf(“n

地址=%s”,p->addre);

printf(“nn 操 作 →

⑴更改数据

⑵删除数据

⑶查询其他数据

⑷返回上页

⑸退出程序nn 请您选择操作:”);

mx:

scanf(“%d”,&a);

switch(a){

void hjedit(struct hj *headd,struct hj *pp);void hjdelete(struct hj *headdd,struct hj *);case 1: hjedit(head,p);goto mmx;break;case 2: hjdelete(head,p);

goto mmx;break;

case 3: goto mmx;

case 4: goto jjx;

case 5:exit(0);

default:printf(“n

错误的选择,请重新选择:”);

goto mx;} }

else

p=p->next;}

int iiii=0;

printf(“n

没有此记录 1.重新查询 2.返回上一页 3.退出程序!”);

printf(“n

请选择:”);

qqqq:

scanf(“%d”,&iiii);

switch(iiii)

{

} case 1: goto mmx;case 2: goto jjx;case 3: exit(0);default: printf(“n

错误的选择,请重新选择:”);goto qqqq;

goto jjx;}

jjx:;} void hjxhselect(void)//按姓名方式查询函数 {

mm: int n=0;char hh[10];system(“cls”);printf(“n

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

★★★查询编辑信息★★★n”);printf(“n

〒提示输入0返回上级菜单〒nnn”);printf(“

请您输入姓名:”);scanf(“%s”,hh);if(strcmp(hh,“0”)!=0){ struct hj *p;

struct hj *q=NULL,*head=NULL;

fp=fopen(“hj.txt”,“rb”);

if(fp==NULL)

{

printf(“n没有记录,请输入记录然后再查询!”);

getch();

goto jjj;

}

while(!feof(fp))

{

n++;p=(struct hj *)malloc(sizeof(struct hj));fread(p,sizeof(struct hj),1,fp);if(n==1)else head=p;

q->next=p;

q=p;

}

q->next=NULL;

p=head;

while(p!=NULL)

{

if(strcmp(p->name,hh)==0){ int a;

printf(“n 结 果 →

学号=%ld

姓名=%s

年龄=%d

性别=%s ”,p->number,p->name,p->age,p->sex);

printf(“n

地址=%s”,p->addre);

printf(“nn 操 作 →

⑴更改数据

⑵删除数据

⑶查询其他数据

⑷返回上页

⑸退出程序nn 请您选择操作:”);

m:

scanf(“%d”,&a);

switch(a)

{

}

} void hjedit(struct hj *headd,struct hj *pp);void hjdelete(struct hj *headdd,struct hj *);case 1: hjedit(head,p);

goto mm;break;case 2: hjdelete(head,p);goto mm;break;case 3: goto mm;case 4: goto jjj;case 5:exit(0);default:printf(“n

错误的选择,请重新选goto m;

择:”);

else

p=p->next;

}

int iii=0;

printf(“n

没有此记录 1.重新查询 2.返回上一页 3.退出程序!”);

printf(“n

请选择:”);

qqq:

scanf(“%d”,&iii);

switch(iii)

{

case 1: goto mm;case 2: goto jjj;case 3: exit(0);

default: printf(“n

错误的选择,请重新选择:”);

goto qqq;

}

goto jjj;}

jjj:;} void hjjgselect(void)//按籍贯方式查询 { yyy:

int i;

system(“cls”);

printf(“n

★★★★★欢迎使用户籍管理系统★★★★★n”);

printf(“n

★★★籍贯方式查询信息★★★nnn”);

printf(“n

显示所有信息n”);

printf(“n

显示四川籍所有信息n”);

printf(“n

显示其它籍所有信息n”);

printf(“n

自定义查询信息n”);

printf(“n

←返回上级菜单n”);

printf(“n

↓退出程序n”);

printf(“nn

请选择:”);

scanf(“%d”,&i);

switch(i){

void zdyselect(void);

} void zdyselect(void){

mmz: int n=0,j=0;char hh[10];system(“cls”);printf(“n

★★★★★欢迎使用户籍管理系统★★★★★n”);

} void allselect(char a[8]);case 1:allselect(“hj.txt”);goto yyy;break;case 2: allselect(“schj.txt”);goto yyy;break;case 3: allselect(“qthj.txt”);goto yyy;break;case 4: zdyselect();case 5: break;case 6: exit(0);printf(“n

★★★自定义查询信息★★★nnn”);

printf(“

请您输入地址关键字:”);

scanf(“%s”,hh);

if(strcmp(hh,“0”)!=0){

struct hj *p;struct hj *q=NULL,*head=NULL;fp=fopen(“hj.txt”,“rb”);if(fp==NULL){

} printf(“n

没有记录,请输入记录然后再查询!”);getch();goto jjz;

while(!feof(fp))

{

} n++;p=(struct hj *)malloc(sizeof(struct hj));fread(p,sizeof(struct hj),1,fp);if(n==1)head=p;else q->next=p;q=p;

q->next=NULL;

p=head;

while(p!=NULL)

{

if(strstr(p->addre,hh)!=NULL)

{

int a;j++;printf(“n 结 果 →

学号=%ld

姓名=%s

年龄=%d

性别=%s ”,p->number,p->name,p->age,p->sex);

printf(“n

地址=%s”,p->addre);printf(“nn 操 作 →

⑴更改数据

⑵删除数据

⑶查询下一条数据

⑷返回上页

⑸退出程序nn 请您选择操作:”);

mz:

scanf(“%d”,&a);switch(a){

void hjedit(struct hj *headd,struct hj *pp);void hjdelete(struct hj *headdd,struct hj *);

case 1: hjedit(head,p);goto mmz;break;case 2: hjdelete(head,p);goto mmz;break;case 3: p=p->next;continue;case 4: goto jjz;case 5:exit(0);default:printf(“n

错误的选择,请重新选

择:”);goto mz;

}

p=p->next;

}

else

p=p->next;}

if(j==0)

{

printf(“nnn没有匹配的记录 按任意键继续!”);

getch();fclose(fp);

goto mmz;

}

else

{

int xx;printf(“nn查询完毕!

继续查询

返回上一级菜单程序”);

printf(“n请选择:”);

scanf(“%d”,&xx);

if(xx==2)

goto jjz;

else if(xx==3)exit(0);

}

goto mmz;

jjz:;}

} void allselect(char a[8])//全部查询 { int n=0;int k=0;⑶

退出 system(“cls”);printf(“n

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

★★★籍贯方式信息★★★nnn”);

struct hj *p;struct hj *q=NULL,*head=NULL;

fp=fopen(a,“rb”);if(fp==NULL){ printf(“n对不起,没有记录无法查询!”);goto xxxx;} rewind(fp);while(!feof(fp)){

n++;p=(struct hj *)malloc(sizeof(struct hj));fread(p,sizeof(struct hj),1,fp);if(n==1)head=p;else q->next=p;q=p;} q->next=NULL;

struct hj *h1,*p2,*q3,*r4,*s5;h1=p2=(hj *)malloc(sizeof(struct hj));

p2->next=head;while(p2->next!=NULL){

q3=p2->next;r4=p2;

while(q3->next!=NULL){

if(q3->next->number

next->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);

while(p!=NULL&&n>0){ n--;printf(“n学号=%ld

姓名=%s

年龄=%d

性别=%s

p=head;”,p->number,p->name,p->age,p->sex);

printf(“n地址=%s”,p->addre);

p=p->next;}

xxxx: printf(“n→显示完毕←n⑴ ↑返回上级菜单

⑵ ↓退出程序 n请 选 择 :”);xxx: scanf(“%d”,&n);switch(n){

} case 1:break;case 2:exit(0);default:printf(“n错误的选择,请重新选择:”);goto xxx;} void hjselect(void)//查询编辑信息函数 {

cxbegin: int a;

system(“cls”);printf(“n

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

★★★查询编辑信息★★★nnn”);printf(“n

按学号方式查询n”);printf(“n

按姓名方式查询n”);printf(“n

按籍贯方式查询n”);printf(“n

→显示全部信息n”);printf(“n

←返回上级菜单n”);printf(“n

请 选 择 查 询 方 式:”);cxmm: scanf(“%d”,&a);switch(a){

case 1: hjxmselect();goto cxbegin;break;

} case 2: hjxhselect();goto cxbegin;break;case 3: hjjgselect();goto cxbegin;break;case 4: allselect(“hj.txt”);goto cxbegin;break;case 5: break;default:printf(“n错误的选择,请重新选择:”);

goto cxmm;} void hjde(void)//删除界面函数 {

cxxbegin: int a;system(“cls”);printf(“n

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

★★★删除信息★★★nnn”);printf(“n

按学号方式删除n”);printf(“n

按姓名方式删除n”);printf(“n

按籍贯方式删除n”);printf(“n

→删除全部信息n”);printf(“n

←返回上级菜单n”);printf(“n

请 选 择 删 除 方 式:”);cxxmm: scanf(“%d”,&a);int i=0;switch(a){

case 1: hjxmselect();goto cxxbegin;break;

case 2: hjxhselect();goto cxxbegin;break;case 3: zdyselect();goto cxxbegin;break;case 4:

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();

”);

}

} } goto cxxbegin;break;case 5: break;default:printf(“n错误的选择,请重新选择:”);goto cxxmm;//==============删除函数接口=============== void hjdelete(struct hj *headdd,struct hj *){

struct hj *q;char d[5]=“四川”;if(headdd==){ headdd=headdd->next;goto gogo;} q=headdd;while(q!=NULL){ if(q->next->number==->number)

{

break;

}

q=q->next;}

q->next=->next;gogo: q=headdd;

fp=fopen(“hj.txt”,“wb”);

while(q!=NULL){ fwrite(q,sizeof(struct hj),1,fp);q=q->next;} fclose(fp);q=headdd;fp=fopen(“schj.txt”,“wb”);while(q!=NULL)

if(strstr(q->addre,d)!=NULL){

fwrite(q,sizeof(struct hj),1,fp);}

{

q=q->next;} fclose(fp);q=headdd;fp=fopen(“qthj.txt”,“wb”);while(q!=NULL)

if(strstr(q->addre,d)==NULL){ fwrite(q,sizeof(struct hj),1,fp);} q=q->next;

{ } fclose(fp);} //===============编辑函数接口============== void hjedit(struct hj *headd,struct hj *pp){ int n=0;

struct hj *p,*p1,*p2;char d[5]=“四川”;printf(“n 输 入 →

学号=”);scanf(“%ld”,&pp->number);printf(“n

姓名=”);scanf(“%s”,pp->name);printf(“n

年龄=”);scanf(“%d”,&pp->age);printf(“n

性别=”);scanf(“%s”,pp->sex);printf(“n

地址=”);scanf(“%s”,pp->addre);p=headd;fp=fopen(“hj.txt”,“wb”);while(p!=NULL){ fwrite(p,sizeof(struct hj),1,fp);p=p->next;} fclose(fp);p1=headd;fp=fopen(“schj.txt”,“wb”);while(p1!=NULL)

{

if(strstr(p1->addre,d)!=NULL)

} {

fwrite(p1,sizeof(struct hj),1,fp);} p1=p1->next;fclose(fp);p2=headd;fp=fopen(“qthj.txt”,“wb”);while(p2!=NULL)

} if(strstr(p2->addre,d)==NULL){

} fwrite(p2,sizeof(struct hj),1,fp);

{ p2=p2->next;fclose(fp);} /*****************************主函数****************************************/ int main(int argc, char* argv[]){

begin:

int t;system(“cls”);printf(“n

★★★★★欢迎使用户籍管理系统★★★★★nnnnn”);printf(“

1.录入学生籍贯信息nn”);printf(“

2.查编学生籍贯信息nn”);

printf(“

3.删除学生籍贯信息nn”);printf(“

4.退出程序nn”);

printf(“

请您选择1-4:”);mm:

scanf(“%d”,&t);switch(t){

case 1: hjnew();break;

case 2: hjselect();break;case 3: hjde();break;case 4:exit(0);default:printf(“n

错误的选择,请重新选择:”);goto mm;} goto begin;

return 0;

学生管理系统

import java.awt.*; import java.awt.event.*; import java.sql.*; import java.util.*; import javax.swing.*; public cla Xsglxt extends JFrame implements ActionListe......

杨玉环籍贯

杨玉环籍贯杨玉环是中国古代四大美女之一,她姿质丰艳,善歌舞,通音律,她让六宫粉黛无颜色,让无数的人沉迷。但是最终她一缕香魂永远留在了马嵬坡。 这是时代的悲哀,也是一位女子的......

学生成绩管理系统

//*学生成绩管理系统*//#include#define N 3struct student{int no;char name[20];float english;float computer;float math;float average;};void getcla(struct student......

学生管理系统总结

从暑假开始到现在,刚把学生管理系统做完,大概用了十天的时间,在做系统的过程中学会了很多东西,虽然,有些还不太会用,不过,以后,应该会慢慢熟练的。这个系统中感觉最难的部分应该就是......

学生管理系统使用说明

学生系统使用说明登录在浏览器地址栏内输入“202.195.128.108”后点击回车,弹出苏大研究生管理系统登录窗口。如图1所示。图1 在图一所示窗口输入用户名、密码、验证码等信息......

下载学生籍贯管理系统word格式文档
下载学生籍贯管理系统.doc
将本文档下载到自己电脑,方便修改和收藏。
点此处下载文档

文档为doc格式

热门文章
点击下载本文