From b0e3fbb7945237ea5593779c3103e85a4562c491 Mon Sep 17 00:00:00 2001 From: m87902354 <18408200220@stu.hut.edu.cn> Date: Fri, 11 Jan 2019 16:20:27 +0800 Subject: [PATCH] first commit --- 主函数.c | 1 + 登录模块.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 登录模块.c diff --git a/主函数.c b/主函数.c index dd34cf4..d0ce00c 100644 --- a/主函数.c +++ b/主函数.c @@ -4,6 +4,7 @@ #include".c" #include"ȡ.c" #include"עģ.c" +#include"¼ģ.c" void qukuan(); void cunkuan(); void chaxun(); diff --git a/登录模块.c b/登录模块.c new file mode 100644 index 0000000..30c1665 --- /dev/null +++ b/登录模块.c @@ -0,0 +1,43 @@ +void denglu() +{ + FILE *fp=fopen("users.txt","r"); + char account[10+ 1],password[6 + 1],r; + int m=0,i; + printf("ʺ:"); + scanf("%s",account); + printf(":"); + scanf("%s",password); + while (m<=2) /*жǷ3*/ + { + for(i=0;i<=n;i++) + { + fscanf(fp,"%s %s %f\n",&zh[i].gUser,&zh[i].gMima,&zh[i].YuE); + if((strcmp(zh[i].gUser,account)==0)&&(strcmp(zh[i].gMima,password)==0)) + { + system("cls"); + printf("½ɹ!"); + fclose(fp); + h=i; + welcome3(); + break; + } + } + rewind(fp); /*´ļһֵ֤*/ + printf("ʺŲڻ벻ȷ!\n:\n"); + m++; + printf("ʺ:"); + fflush(stdin); + gets(account); + fflush(stdin); + printf(":"); + fflush(stdin); + gets(password); + fflush(stdin); + } + fclose(fp); + printf("ʺ벻ȷѾ3,ǿ˳ϵͳ(˳)!"); + fflush(stdin); + scanf("%c",&r); + fflush(stdin); + exit(0); +}