From 86efccb00dc1d1a4dedf34a1235883f1ec7ecc8f Mon Sep 17 00:00:00 2001 From: m87902354 <18408200220@stu.hut.edu.cn> Date: Fri, 11 Jan 2019 16:13:26 +0800 Subject: [PATCH] first commit --- 主函数.c | 4 +++- 注册模块.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 注册模块.c diff --git a/主函数.c b/主函数.c index 56b147f..dd34cf4 100644 --- a/主函数.c +++ b/主函数.c @@ -2,12 +2,14 @@ #include #include #include".c" +#include"ȡ.c" +#include"עģ.c" void qukuan(); void cunkuan(); void chaxun(); void xiugaimima(); void zhuanzhang(); -int n=3; +int n=10; int h; struct zanghu { diff --git a/注册模块.c b/注册模块.c new file mode 100644 index 0000000..542cb0b --- /dev/null +++ b/注册模块.c @@ -0,0 +1,52 @@ +void zhuce() +{ + FILE *fp; + char user[30],mima1[30],mima2[30]; + int i,j=0,a; + float m; + welcome2(); + printf("д˺: "); + fp=fopen("users.txt","a+"); + scanf("%s",user); + for(i=0;i<10+1;i++) + { + fscanf(fp,"%s %s %f\n",&zh[i].gUser,&zh[i].gMima,&zh[i].YuE); + if(strcmp(zh[i].gUser,user)==0) + { + printf("˺Ѵ\n"); + main(); + break; + } + else if(i==n) + { + strcpy(zh[i].gUser,user); + while(j!=1) + { + printf(": "); + scanf("%s",mima1); + printf("ٴ: "); + scanf("%s",mima2); + if(strcmp(mima1,mima2)==0) + { + printf("óɹ\n"); + strcpy(zh[i].gMima,mima1); + printf("Ĵ "); + scanf("%f",&m); + zh[i].YuE=m; + fprintf(fp,"%s %s %f\n",zh[i].gUser,zh[i].gMima,zh[i].YuE); + j=1; + printf("%.3f\n",zh[i].YuE); + fclose(fp); + printf("밴0棡\n"); + scanf("%d",&a); + if(a==0) + { + system("cls"); + main(); + } + break; + } + } + } + } +}