From 573296c464e35abb6fb42c02a2bc41a3163fbfda Mon Sep 17 00:00:00 2001 From: "1052720016@qq.com" <1052720016@qq.com> Date: Thu, 10 Jan 2019 11:51:24 +0800 Subject: [PATCH] 6th commit --- 5.c | 224 ------------------------------------------------- 5.exe => 6.exe | Bin 110008 -> 110008 bytes 2 files changed, 224 deletions(-) delete mode 100644 5.c rename 5.exe => 6.exe (79%) diff --git a/5.c b/5.c deleted file mode 100644 index 43cbd71..0000000 --- a/5.c +++ /dev/null @@ -1,224 +0,0 @@ -#include -#include -#include -#include -#include -struct birth -{ - int year,month,day; -}; -struct student -{ - int number,age,tel[20]; - char name[10],sex,address[20]; - char E_mail[20]; - struct birth birthday; - struct student *link; -}; -void show() -{ - printf("请输入数字加回车键进行选择:\n"); - printf("1.学生信息录入功能(学生信息用文件保存)-输入\n"); - printf("2.学生信息浏览功能-输出\n"); - printf("3.学生信息查询功能-按学号查询,按姓名查询\n"); - printf("4.学生信息的删除与修改\n"); - printf("按其他任意键加回车退出程序\n"); -} -void credit(int n) -{ - FILE *fp; - char fpname[20]; - struct student *head,*next,*end; - int i; - printf("请输入用于存放文件的路径及路径名:"); - scanf("%s",fpname); - getchar(); - fp=fopen(fpname,"a+"); - head=(struct student *)malloc(sizeof(struct student)); - printf("请输入学生学号 姓名 性别 出生年 月 日 地址 电话 e_mail:"); - scanf("%d %s %c %d %d %d %s %s %s",&head->number,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail); - getchar(); - fprintf(fp,"%d %s %c %d %d %d %s %s %s",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail); - end=head; - for(i=1;inumber,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail); - getchar(); - fprintf(fp,"%d %s %c %d %d %d %s %s %s",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail); - end->link=next; - end=next; - end->link=NULL; - } - fclose(fp); -} -int show2(int n) -{ - - FILE *fp; - int i; - char fpname[20]; - struct student *head; - head=(struct student *)malloc(sizeof(struct student)); - printf("请输入用于存放信息的文件路径及文件名:"); - gets(fpname); - fp=fopen(fpname,"r+"); - for(i=0;inumber,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail); - printf("%d %s %c %d %d %d %s %s %s\n",&head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail); - } - fclose(fp); -} -int search1(int n) -{ -int i,checkname; -FILE *fp; -char fpname[20]; -struct student *head; -head=(struct student *)malloc(sizeof(struct student)); -printf("请输入存放信息的文件路径及文件名:"); -gets(fpname); -fp=fopen(fpname,"r+"); -printf("请输入要查询信息的学生学号:"); -scanf("%d",&checkname); -getchar(); -for(i=0;inumber,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail); - if(checkname==head->number) - { - printf("%d %s %c %d %d %d %s %s %s\n",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail); - fclose(fp); - return(1); - } -} - printf("未找到"); -} -int search2(int n) -{ - int i; - FILE *fp; - char fpname[20],checkname[20]; - struct student *head; - head=(struct student *)malloc(sizeof(struct student)); - printf("请输入存放信息的文件路径及文件名:"); - gets(fpname); - fp=fopen(fpname,"r+"); - printf("请输入要查询信息的学生姓名:"); - scanf("%s",&checkname); - getchar(); - for(i=0;inumber,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail); - if(strcmp(checkname,head->name)==0) - { - fprintf(fp,"%d %s %c %d %d %d %s %s %s",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail); - fclose(fp); - return(1); - } - } - printf("未找到\n"); -} -int most(n) -{ - FILE *fp; - char get; - char fpname[20]; - struct student *ans[500]; - int i; - char checkname[10]; - printf("请输入存放信息的文件路径及文件名:"); - gets(fpname); - fp=fopen(fpname,"r+"); - ans[0]=(struct student *)malloc(sizeof(struct student)); - fscanf(fp,"%d %s %c %d %d %d %s %s %s",&ans[0]->number,ans[0]->name,&ans[0]->sex,&(*ans[0]).birthday.year,&(*ans[0]).birthday.month,&(*ans[0]).birthday.day,ans[0]->address,ans[0]->tel,ans[0]->E_mail); - for(i=0;inumber,ans[i]->name,&ans[i]->sex,&(*ans[i]).birthday.year,&(*ans[i]).birthday.month,&(*ans[i]).birthday.day,ans[i]->address,ans[i]->tel,ans[i]->E_mail); - ans[i-1]->link=ans[i]; - } - ans[i]->link=NULL; - printf("如果想修改信息请输入1加回车键,想删除信息输入2加回车键:"); - get=getchar(); - getchar(); - if(get=='1') - { - printf("请输入要修改信息的学生姓名:"); - scanf("%s",checkname); - getchar(); - for(i=0;iname)==0) - { - printf("请输入学生新信息 学号 姓名 性别 出生年 月 日 地址 电话 e-mail:"); - scanf("%d %s %c %d %d %d %s %s %s",&ans[i]->number,ans[i]->name,&ans[i]->sex,&(*ans[i]).birthday.year,&(*ans[i]).birthday.month,&(*ans[i]).birthday.day,ans[i]->address,ans[i]->tel,ans[i]->E_mail); - getchar(); - } - } - } - if(get=='2') - { - printf("请输入要删除的学生姓名:"); - scanf("%s",checkname); - getchar(); - for(i=0;iname)==0) - { - ans[i-1]->link=ans[i]->link; - n--; - break; - } - } - } - fp=fopen(fpname,"w+"); - for(i=0;inumber,ans[i]->name,ans[i]->sex,(*ans[i]).birthday.year,(*ans[i]).birthday.month,(*ans[i]).birthday.day,ans[i]->address,ans[i]->tel,ans[i]->E_mail); - } - fclose(fp); - return(n); -} -void main () -{ - char get,get2; - int n; - while(1) - { - show(); - get=getchar(); - getchar(); - switch(get) - { - case '1': - printf("请输入学生人数:"); - scanf("%d",&n); - getchar(); - credit(n); - break; - case '2': - printf("请输入学生人数:"); - scanf("%d",&n); - getchar(); - show2(n); - break; - case '3': - printf("按学号查找输入1加回车键,按姓名查找输入2加回车键:"); - get2=getchar(); - getchar(); - if(get2=='1') - search1(n); - if(get2=='2') - search2(n); - break; - case '4': - n=most(n); - break; - } - if(get!='1'&&get!='2'&&get!='3'&&get!='4') - break; - } -} diff --git a/5.exe b/6.exe similarity index 79% rename from 5.exe rename to 6.exe index de5b82d11b50de413050f0242565eadd6425c3a6..ca7ee408952d4b679da7d31fcae1c21d1b0fcdd9 100644 GIT binary patch delta 5568 zcmZu!30PD|wytw&u-R;u24w36xA|wH0tjTagR|k;YQ5 z8e_Nw&3)lDPjJ-&~+fBk2vQ>RXyd%NzM zN8L3KYnc>yy!xHtZu{b;>T6r6#uw~udXduY^?CvQqn->OAN|#g`qs%plH%W@tO`ATFsAjh^L$UZU;TpabINuRr7vI zJ$^q4sCrm-!0wd%KL(^Cdxbn1bp|_bq<-S%-uVQ*zm__l= zJc~X42C``{AMW)I_2A!lMfxAq2(63IN*M{QA2j@P&u|{)o!em!Bu#}HKEf-Azwcd0 zkGb0CMLNxg`$Qz9MhdG&Seb=Y0j8B{pNc3p0E)oYgKwo~@(n&5=3RZ4(*VB5H;mHx z8Q+LEPKUdk)Cnh#Fs)2GDV#(`w0Gj5esd^`&HY0tf96oW+M1V#f~p7A)WG|6v{EMj ztRweX9fop9`&Kyoh)-8VQ4X(EX>%E9XY7t;lQ3-!bTr_fVvlzyi)GnsSVQ4ZKG6O+ z9*1Jtrx;GB-A3A3b3g9uw^GBwRHQYQ)Q=U)m1ze=7;l3ttyh(<=X?D|1{f-`J}e(^ z&{bsB;1N-gwVA)93hxmiHggE&-WvNAz&cTDcOy#DZc|0t?Y?PB)v7wwC&GFxv{&+} z{!t0jpjesqnOJDGxGim`;GptAIk)Yoj;FlN-%dxkIUt0(^0I(ibb?P0OgHrp#&(8a zC`-H9WWv)@d^1T^`da^4D1rD1{V8lMAVR* zg;jkJ{~{=q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