From a891644b467a6feed0480712d534db69bdfff5aa Mon Sep 17 00:00:00 2001 From: m59637281 <18408000220@stu.hut.edu.cn> Date: Thu, 10 Jan 2019 22:15:18 +0800 Subject: [PATCH] final6 --- account.txt | 1 + bankstandard.c | 375 +++++++++++++++++++ bankstandard.exe | Bin 0 -> 36032 bytes bankstandard.o | Bin 0 -> 9051 bytes define_struct.c | 9 + del_account.c | 14 + get_account.c | 22 ++ insert_account.c | 16 + list_account.c | 12 + search_account.c | 17 + search_key.c | 7 + store_account.c | 7 + 不会PULL,老师成品是bankstandard.txt | 1 + 13 files changed, 481 insertions(+) create mode 100644 account.txt create mode 100644 bankstandard.c create mode 100644 bankstandard.exe create mode 100644 bankstandard.o create mode 100644 define_struct.c create mode 100644 del_account.c create mode 100644 get_account.c create mode 100644 insert_account.c create mode 100644 list_account.c create mode 100644 search_account.c create mode 100644 search_key.c create mode 100644 store_account.c create mode 100644 不会PULL,老师成品是bankstandard.txt diff --git a/account.txt b/account.txt new file mode 100644 index 0000000..0545106 --- /dev/null +++ b/account.txt @@ -0,0 +1 @@ +123456 456456 zm 12.56 \ No newline at end of file diff --git a/bankstandard.c b/bankstandard.c new file mode 100644 index 0000000..e77c5f1 --- /dev/null +++ b/bankstandard.c @@ -0,0 +1,375 @@ +#include +#include +#include +#include +#define BUFFERSIZE 1024 +#define MAXACCOUNT 1000 +#define ADMINISTRATIOR 123456 + +typedef struct bankaccount//˻ʽ +{ + int account; + int key; + char name[32]; + float balance; +}BANKACCOUNT; +BANKACCOUNT accountcollection[MAXACCOUNT]; +int cur_account = 0; + + +void insert_account(FILE *fp, int accountnum)//½˻ +{ + BANKACCOUNT newaccount; + newaccount.account = accountnum; + int subkey; + + printf("˺Ϣ\n"); + printf(">>˺Ϊ:"); + printf("%d\n", accountnum); + printf(">>:"); + scanf("%d",&(newaccount.key)); + system("cls"); + printf("ٴղŵ룺\n"); + do{ + scanf("%d", &subkey); + getchar(); + if (subkey == newaccount.key) + break; + else + printf("ε벻һ\nٴһε0˳ע\n"); + }while (subkey != 0); + if (subkey != 0) + { + printf("óɹ\n ƸϢ\n"); + printf(">>:"); + scanf("%s",newaccount.name); + printf(">>ʼ:"); + scanf("%f",&(newaccount.balance)); + fseek(fp,0L,SEEK_END); + fprintf(fp,"%d %d %s %.2f\n",newaccount.account,newaccount.key,newaccount.name,newaccount.balance); + printf("˻ɹ\n"); + } + else + printf("ʧܣ"); +} +void store_account(FILE*fp) +{ + int i = 0; + for(i = 0;i 0) + { + switch(i) + { + case 1: + if(!(fp = fopen("account.txt","a+"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + printf("ʼ˻\n"); + scanf("%d", &accountnum); + while (search_account(fp,accountnum,0) && accountnum != 0) + { + printf("˻ѱռã\nԼ˻Ż0\n"); + scanf("%d\n", &accountnum); + } + if(accountnum != 0) + insert_account(fp, accountnum); + else + printf("ʧܣ\n"); + printf("س˵!\nлʹ!"); + getch(); + fclose(fp); + break; + + case 2: + if(!(fp = fopen("account.txt","r"))) + { + printf("ϵͳûϢ\n"); + exit(0); + } + printf("Ա:\n"); + long int n; + scanf("%ld", &n); + while (n != ADMINISTRATIOR) + { + printf("ȷ0һ:\n"); + scanf("%ld", &n); + if (n == 0) + break; + } + if (n != 0) + { + + get_account(fp); + list_account(fp); + fclose(fp); + printf("سβ!\nлʹ!\n"); + getch(); + } + break; + + case 3: + printf("˺:\n"); + scanf("%d",&accountnum); + if(!(fp = fopen("account.txt","r"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + get_account(fp); + if(!search_account(fp,accountnum,1)) + printf("˻ڣ%d\n",accountnum); + fclose(fp); + printf("سβ!\nлʹ!"); + getch(); + break; + + case 4: + printf("˺:\n"); + scanf("%d",&accountnum); + if(!(fp = fopen("account.txt","r"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + get_account(fp); + fclose(fp); + if(!(fp = fopen("account.txt","w+"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + del_account(fp,accountnum); + fclose(fp); + printf("سβ!\nлʹ!"); + getch(); + break; + + case 5: + printf("˺\n"); + scanf("%d",&accountnum); + if(!(fp = fopen("account.txt","r"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + get_account(fp); + fclose(fp); + if(!(fp = fopen("account.txt","w+"))) + { + printf("˻ļʧܣ\n"); + exit(0); + } + if(search_account(fp,accountnum,0)) + { + int i = search_account(fp,accountnum, 0) - 1; + int key; + do{ + printf("ȷ0˳ù"); + scanf("%d", &key); + system("cls"); + if(search_key(fp, key, i)) + break; + }while ( key != 0); + while (key != 0) + { + system("cls"); + printf("********************************************\n"); + printf("뿪ͷѡҪеIJ\n"); + printf("0 :˳ѡ\n"); + printf("1 :ȡ\n"); + printf("2 :\n"); + printf("********************************************\n"); + scanf("%d", &key); + system("cls"); + if (key >= 0&&key <=2) + { + switch(key) + { + case 1: + printf("ҪȡĽ"); + scanf("%f", &withdraw); + if(accountcollection[i].balance > withdraw) + { + accountcollection[i].balance -= withdraw; + printf("\nڵΪ %.2f\n", accountcollection[i].balance); + } + else + printf("\n"); + printf("س\n"); + getch(); + break; + + + case 2: + printf("ҪĽ"); + scanf("%f", &store); + accountcollection[i].balance += store; + printf("\nڵΪ %.2f\n", accountcollection[i].balance); + printf("س\n"); + getch(); + break; + + + default : + printf("лʹ\n"); + break; + } + } + else + { + printf("Чָ1 2еһ.\n"); + printf("س\n"); + getch(); + } + } + } + else + printf("˻\n"); + store_account(fp); + fclose(fp); + printf("س\n"); + getch(); + break; + + + default: + printf("лʹã\n"); + break; + } + } + else + { + printf("Чָ1 6еһ.\n"); + printf("س\n"); + getch(); + } + +}while(i != 6); + + return 0; +} + diff --git a/bankstandard.exe b/bankstandard.exe new file mode 100644 index 0000000000000000000000000000000000000000..c28c52c884bd7c24556effaee44ded225a523b3e GIT binary patch literal 36032 zcmeHw3wTu3wf~;U0AmPAkWgbA%h*PnDue_AB0`-ZnUH8mVjdb1Jq(jch)f=xnIKxc zhC8695u4j;YyI?oM7fnqZU2g(C_WHp({IW>04s08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j$dS#P%!HtIvdQJR@ZM2befH6q< zq1KX~_c0uxD2oH4%QVu2TbtEDbIO6*yvk9W`4*^@@_BQMXx9evld0R{EEuf%_?eAj z0H?5}7?_6WkXyoP(9j#lILgB(7*MRr@qmb* z#bWf<+*WVgaqb!_bTEz0r629aT cq0|}<@I@jYf3Z^KI}X}Fvp=WTh(px>AE_77K>z>% literal 0 HcmV?d00001 diff --git a/bankstandard.o b/bankstandard.o new file mode 100644 index 0000000000000000000000000000000000000000..00f09c5d1be4e6609a0c27f70ef6714a2acaa79c GIT binary patch literal 9051 zcmcgy3vg8B6}}q+#1KtdLqUplgNsH85fCZFim2@PqLr!OP)kW;vVoL5nCu1wYsD_9 zq&oqN_$*pORA_XHmz3#9bS-cwvkl>50apQO;9-3UfI)C_wmf|d+e1HcV-0zZpPf{${%EQc~+JF7QXZ&(6GLu ztiT%-)^&s!!OIj2k1Y!89?^z}U$J|p*g}FZz`MRW9(zbmuuT_r$lj*w+IwV{Ei(6~ zd)+%ia;DlMa;Dp;BOx^70A`wIAl>IGa3Bn$b81voq4#>i9(x-o&3FsU_SoCzmB;k8 zf;%)h#2ArB?xW_BXIiky=Fv#eb+owcZI(QW7Xtc z?>)QF@)iudZjopqDv!vux8f}<*M3&@;am8a`rsKz!94b}^Xg+>+DSMkNO7%Q+(W^- zKxzQ_aUKfcqRK7#GzUpNlf&G{BC^ZFmp%ebw1Fu*Ck{G5T^?R~>vZlpnQb}24doyX{M zJRY$TVxmfc@GY0j%B3n;I0V}*yd-0IFA*9*VHl^7Z$Ivb0 z(Qj$zxI)N|ty9YHt{>35*>7QcXJ_}D1u}l3GU~0x6g?!VZfV8E68VDb;R4TV6x*Nz z^eDDP@hCRZDE1r01xAo}AEPzBc|b`diU|q~Aawua&n;S34U?`oC3Dr+ot+A&cXVNr zj|4WAK(DQ3DC%h$L`4PL9#y8^mg4$F_qxJL$rbb&SYIpbU(LJ*tDzEQMUvfU%5)_~ z&F@|PY`UF(x5Di#Ty_BUAsOnB_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1qgsomrWt_ zFBKpFK1kZ*F#k${tbHuBueu+xre7#PBz)*M3jMk}VU%ewWa(p}-Fx-%0;ppjF;BWR zjsEga2Pq8F;^S36h{Nh=@$)lN(p||k#Gy0J#DsK37|bH4%aO(|%*=7P66YoulJr^0 zPKRTj;le)2=FoKjEZJ~1m(T>lO33o+OL literal 0 HcmV?d00001 diff --git a/define_struct.c b/define_struct.c new file mode 100644 index 0000000..a289aa8 --- /dev/null +++ b/define_struct.c @@ -0,0 +1,9 @@ +typedef struct bankaccount//˻ʽ +{ + int account; + int key; + char name[32]; + float balance; +}BANKACCOUNT; +BANKACCOUNT accountcollection[MAXACCOUNT]; +int cur_account = 0; diff --git a/del_account.c b/del_account.c new file mode 100644 index 0000000..774aa15 --- /dev/null +++ b/del_account.c @@ -0,0 +1,14 @@ +void del_account(FILE *fp,int accountnum)//ɾ˺Ϣģ +{ + int i; + if(search_account(fp,accountnum)==0) + printf("޷ҵ˻\n"); + else + { + for(i = 0;i>˺:"); + scanf("%d",&(newaccount.account)); + printf(">>:"); + scanf("%d",&(newaccount.key)); + printf(">>:"); + scanf("%s",newaccount.name); + printf(">>:"); + scanf("%f",&(newaccount.balance)); + fseek(fp,0L,SEEK_END); + fprintf(fp,"%d %d %s %.2f\n",newaccount.account,newaccount.key,newaccount.name,newaccount.balance); +} diff --git a/list_account.c b/list_account.c new file mode 100644 index 0000000..4a43e49 --- /dev/null +++ b/list_account.c @@ -0,0 +1,12 @@ +void list_account(FILE *fp)//г˺Ϣģ麯 +{ + int i =0; + printf("ϼ%d˺:\n",cur_account-1);// cur_accountȥӵ1 + for(i = 0;i< cur_account-1;i++) + { + printf("˻%d:\n",i+1); + printf("˺:%d\n",accountcollection[i].account); + printf(":%s\n",accountcollection[i].name); + printf(":%.2f\n",accountcollection[i].balance); + } +} diff --git a/search_account.c b/search_account.c new file mode 100644 index 0000000..185596f --- /dev/null +++ b/search_account.c @@ -0,0 +1,17 @@ +int search_account(FILE *fp,int accountnum)//Աģ麯 +{ + int i =0; + for(i = 0;i< cur_account-1;i++) + { + if(accountcollection[i].account == accountnum) + { + printf("˻%d:\n",i+1); + printf("˺:%d\n",accountcollection[i].account); + printf(":%s\n",accountcollection[i].name); + printf(":%.2f\n",accountcollection[i].balance); + + return 1; + } + } + return 0; +} diff --git a/search_key.c b/search_key.c new file mode 100644 index 0000000..2a489e2 --- /dev/null +++ b/search_key.c @@ -0,0 +1,7 @@ +int search_key(FILE *fp,int key,int i) +{ + if (accountcollection[i].key == key) + return 1; + else + return 0; +} diff --git a/store_account.c b/store_account.c new file mode 100644 index 0000000..2868153 --- /dev/null +++ b/store_account.c @@ -0,0 +1,7 @@ +void store_account(FILE*fp) +{ + int i = 0; + for(i = 0;i