课程设计源代码.txt_第1页
课程设计源代码.txt_第2页
课程设计源代码.txt_第3页
课程设计源代码.txt_第4页
课程设计源代码.txt_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

#include #include #include #include #define len sizeof(struct people) #define sch sizeof(struct school) #define cla sizeof(struct classes) int n_n=0,n_n2=0,tc_=0; / int ma_st=0; char name20,code20; /- /* 5 1 1硢 2 3 3 4 5 2 1 2 3 4 5洢 6 3 1 2涨*/ /- int check(int n,char num,char _code); struct people *read_(); / void ban_p(); / void xiazai(); int ma_ten(); / void last(); / /- void student_meu(); / void st_one(char name); / void st_one_one(char name); / void st_two(char name); / void st_two_three(); / void st_three(char name); / void st_four(char name); / /- void manage_meu(); /. void ma_one(); /. void ma_one_one(); /. void ma_change(struct people *p0); /. void ma_two(); /. void ma_two_one(); /. void ma_two_two(); /. void ma_three(); /. void ma_three_one(); / void ma_three_two(); / void ma_three_three(); / void ma_four(); /. void ma_five(); /. void ma_five_one(); /. void ma_five_two(); /. void ma_five_four(); / void ma_five_three(); /. void ma_five_five(); / void ma_six(); / void ma_six_one(); /. void ma_six_two(); /. void ma_six_three(); /. void ma_six_four(); /. /- struct ban / int one;/ int two;/ int three;/; int four30;/ double five30;/ struct ban *next; ; /- struct classes / int one; char ch50; double sum;/ ; /- struct school / int one; / char two20; / int three20; / char four20100;/ struct school *next; ; /- struct people / char st_num20; / char name20; / char sex20; / int age; / char dor_num20; / char ph_num20; /绰 int sub_20; int kao20; / double sub120; / double sub220; / double sub320; / char code20; / int sc_ta50; / int sc_ro50; / char _sc20; / int _sub1; / int _sub2; / int _cla; / int _ji; / float xuefen; / struct people *next; ; /- struct classes* re1(int n) / file *fp; struct classes *p; fp=fopen(“d:fileclasses.txt“,“r“); p=(struct classes*)malloc(cla); while(fread(p,cla,1,fp)!=0) if(n=p-one) break; fclose(fp); return (p); /- struct school* re2(int n) / file *fp; struct school *p; fp=fopen(“d:fileschool.txt“,“r“); p=(struct school*)malloc(sch); while(fread(p,sch,1,fp)!=0) if(n=p-one) break; fclose(fp); return (p); /- struct ban*read_2() / file *fp; n_n2=0; fp=fopen(“d:fileban.txt“,“r“); struct ban *head,*p1,*p2; p1=(struct ban*)malloc(sizeof(struct ban); while(fread(p1,sizeof(struct ban),1,fp)!=0) if(n_n2=0) head=p1;else p2-next=p1; p2=p1; p1=(struct ban*)malloc(sizeof(struct ban); n_n2+; p2-next=null; fclose(fp); return(head); /- struct ban*re3(struct people *p0) / file *fp; fp=fopen(“d:fileban.txt“,“r“); struct ban *p; p=(struct ban*)malloc(sizeof(struct ban); while(fread(p,sizeof(struct ban),1,fp)!=0) if(p-one=p0-_sub1 fclose(fp); return (p); /- struct ban *average(struct ban*p0) / struct people *p1; int i,j,n; double sum20=0; p1=read_(); j=0; while(p1!=null) i=0; if(p0-one=p1-_sub1 i+; j+; p1=p1-next; n=i; while(n0) sumn-1=sumn-1/j; n-; p0-fiven=sumn; return (p0); /- void ma_change2(struct ban *p0) / file *fp; struct ban *p; int flag_1=0; p=read_2(); fp=fopen(“d:fileban.txt“,“w“); while(p!=null) if(p-one=p0-one flag_1=1; else fwrite(p,sizeof(struct ban),1,fp); p=p-next; if(p=null) break; n_n2-; fclose(fp); if(flag_1=0) fp=fopen(“d:fileban.txt“,“a“); / fwrite(p0,sizeof(struct ban),1,fp); fclose(fp); /- struct people *read_() / file *fp; n_n=0; struct people *head,*p1,*p2; fp=fopen(“d:filea.txt“,“r“); p1=(struct people *)malloc(len); while(fread(p1,len,1,fp)!=0) if(n_n=0) head=p1;else p2-next=p1; p2=p1; n_n+; p1=(struct people *)malloc(len); p2-next=null; fclose(fp); return(head); /- void cut_people(struct people *p0) / file *fp; struct people *p; p=read_(); fp=fopen(“d:filea.txt“,“w“); while(n_n0) if(strcmp(p0-st_num,p-st_num)!=0) fwrite(p,len,1,fp); p=p-next; n_n-; fclose(fp); /- void ma_change(struct people *p0) / file *fp; struct people *p; int flag_1=0; p=read_(); fp=fopen(“d:filea.txt“,“w“); while(n_n0) if(strcmp(p0-st_num,p-st_num)=0) fwrite(p0,len,1,fp); flag_1=1; else fwrite(p,len,1,fp); p=p-next; n_n-; fclose(fp); if(flag_1=0) fp=fopen(“d:filea.txt“,“a“); / fwrite(p0,len,1,fp); fclose(fp); /- void ban_p() / file *fp1,*fp2; struct ban *head1,*p1; struct people *head2,*p2; int i; fp1=fopen(“d:fileban.txt“,“r“); fp2=fopen(“d:filea.txt“,“r“); p1=(struct ban*)malloc(sizeof(struct ban); p2=(struct people*)malloc(len); head2=p2=read_(); head1=p1=read_2(); while(p1!=null) while(p2!=null) if(p1-one=p2-_sub1 while(p1-fouri!=0) p2-sc_tai=p1-fouri; i+; p2-sc_tai=0; p2=p2-next; p1=p1-next; fclose(fp1); fclose(fp2); fp2=fopen(“d:filea.txt“,“w“); p2=head2; while(p2!=null) fwrite(p2,len,1,fp2); p2=p2-next; fclose(fp2); /- void begining() / char ch; system(“color 3e“); printf(“:“); system(“date/t“); printf(“:“); system(“time/t“); printf(“nnntttt*n“); printf(“tttt| |n“); printf(“tttt*n“); printf(“nnnttt n“); printf(“nn tt|+|+|+|+|+|+|+|+|+|+|+|+|+|“); printf(“nnnnttenter“); ch=getch(); /- void iden() / system(“cls“); printf(“:“); system(“date/t“); printf(“:“); system(“time/t“); printf(“nnnttn“); printf(“tt n“); printf(“tt n“); printf(“tt 1. n“); printf(“tt n“); printf(“tt n“); printf(“tt 2. n“); printf(“tt n“); printf(“tt n“); printf(“ttnnn“); printf(“t,“); /- void getcode() / char ch1100; int i,flag=0,num=0; ma_st=0; while(1) / i=0; while(ch1i=getch()!=r) putchar(ch1i);i+; if(i1) ch10=9; if(ch10=1) flag=0; /printf(“1“); printf(“.nt“); while(1) i=0; while(codei=getch()!=r iden(); printf(“1.n“); printf(“tn“); else if(check(1,0,code)=1) flag=1;ma_st=1;break; else system(“cls“); iden(); printf(“1.n“); printf(“t“); else if(ch10=2) / flag=0; printf(“nnt“); while(1) i=0; while(namei=getchar()!=n) i+; namei=0; if(i=13) system(“cls“); iden(); printf(“2nn“); printf(“t12“); else break; printf(“t“); while(1) i=0; while(codei=getch()!=r) printf(“*“);i+; codei=0; if(i=16) system(“cls“); iden(); printf(“2nntn%sn“,name); else if(check(2,name,code)=2) flag=1;ma_st=2;break; else system(“cls“); iden(); printf(“2nnt%sn“,name); printf(“t“); else / system(“cls“); iden(); printf(“nt12“); if(flag=1) break; / /- int check(int n,char num,char _code) / file *fp; int i=0; struct people s; if(fp=fopen(“d:filea.txt“,“r“)=null) exit(0); if(n=1) fread( if(strcmp(_code,s.code)=0) i=1; else i=0; fclose(fp); else if(n=2) while(fread( if(strcmp(_code,s.code)=0) i=2; else i=0; fclose(fp); return(i); /12 /- void manage_meu() / char ch100; int i,flag_1=0,flag_2=0; while(1) system(“cls“); printf(“:“); system(“date/t“); printf(“:“); system(“time/t“); printf(“ntttt*n“); printf(“ t+| |+n“); printf(“t|ttt*ttt |n“); printf(“t|ttt ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“ t+nn“); printf(“t“); while(1) i=0; flag_1=0; while(chi=getchar()!=n) i+; if(i1) ch0=9; switch(ch0) case0:flag_2=ma_ten();break; case1:ma_one();break; case2:ma_five();break; case3:ma_six();break; case4:ma_three();break; case5:st_four(“0000“);break; case6:ma_two();break; case7:flag_2=1;break; default:printf(“t“);flag_1=1; if(flag_1=0) break; if(flag_2=1) break; /- void student_meu() /. char ch100; int i,flag_1=0,flag_2=0; while(1) system(“cls“); printf(“:“); system(“date/t“); printf(“:“); system(“time/t“); printf(“ntttt*n“); printf(“ t+| |+n“); printf(“t|ttt*ttt |n“); printf(“t|ttt ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“t|ttt.ttt |n“); printf(“ t+nn“); printf(“t“); while(1) i=0; flag_1=0; while(chi=getchar()!=n) i+; if(i1) ch0=9; switch(ch0) case0:flag_2=ma_ten();break; case1:st_one(name);break; case2:st_two(name);break; case3:st_three(name);break; case4:st_four(name);break; case5:flag_2=1;break; default:printf(“tn“);flag_1=1; if(flag_1=0) break; if(flag_2=1) break; /- void ma_one_one() / file *fp; fp=fopen(“d:filea.txt“,“r“); struct people s; int flag_1=0,flag_2=0,flag_3=0; char ch100; int i=0,n=0; while(fread( fclose(fp); i=0; while(1) system(“cls“); int i=0; flag_2=0; printf(“nnn“); printf(“=nn“); printf(“); scanf(“%s“, printf(“-n“); printf(“); scanf(“%s“, printf(“-n“); printf(“); scanf(“%d“, printf(“-n“); printf(“绰“); scanf(“%s“, strcpy(s.st_num ,“0000“); ch0=getchar(); printf(“=nn“); printf(“ -n“); printf(“ | 1.t2.t3. |n“); printf(“ -n“); printf(“); while(1) i=0; flag_3=0; while(chi=getchar()!=n) i+; if(i1) chi-1=4; switch(chi-1) case 1: ma_change( printf(“棬enter-“); ch0=getchar(); flag_1=1; break; case 2:flag_2=1;break; case 3:flag_1=1;break; default:flag_3=1; if(flag_3=1) printf(“13“); else break; if(flag_1=1) break; /- void ma_one() /. while(1) struct people s; int flag_1=0,flag_2=0; char ch20; int i; file *fp; fp=fopen(“d:filea.txt“,“r“); while(fread( system(“cls“); printf(“n“); printf(“tn“); printf(“ -n“); printf(“ | %s n |ttttt |n“,); printf(“ | %s n |ttttt |n“,s.sex); printf(“ | %2dn |ttttt |n“,s.age); printf(“ | 绰%s n |ttttt |n“,s.ph_num); printf(“ -nn“); fclose(fp); printf(“ -n“); printf(“ | .t . |n“); printf(“ -n“); printf(“ “); while(1) i=0; flag_2=0; while(chi=getchar()!=n) i+; if(i=2) chi-1=3; switch(chi-1) case 1: ma_one_one();break; case 2:flag_1=1;break; default:flag_2=1; if(flag_2=1) printf(“ 12“); else break; if(flag_1=1) break; /- void ma_five() / char ch100; int i,flag_1=0,flag_2=0; while(1) system(“cls“); printf(“nnntttt n“); printf(“tttt*n“); printf(“ t+| |+n“); printf(“t|ttt*ttt |n“); printf(“t|tt . ttt |n“); printf(“t|tt . ttt |n“); printf(“t|tt . ttt |n“); printf(“t|tt . ttt |n“); printf(“t|tt . ttt |n“); printf(“t|tt . ttt |n“); printf(“ t+nnn“); printf(“t“); while(1) i=0; flag_1=0; while(chi=getchar()!=n) i+; if(i1) ch0=9; switch(ch0) case1:ma_five_one();break; case2:ma_five_two();break; case3:ma_five_four();break; case4:ma_five_three();break; case5:ma_five_five();break; case0:flag_2=1;break; default:printf(“t“);flag_1=1; if(flag_1=0) break; if(flag_2=1) break; /- void ma_five_four() / file *fp; file *fp1; file *fp2; fp1=fopen(“d:fileclasses.txt“,“r“); struct people *p1,*p2;

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论