|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
/*
|
|
|
|
|
1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>¼
|
|
|
|
|
2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǯ
|
|
|
|
|
3<EFBFBD><EFBFBD>ȡǮ
|
|
|
|
|
4<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>
|
|
|
|
|
5<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
6<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ
|
|
|
|
|
7<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
8<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ѯ
|
|
|
|
|
9<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ѯ
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
struct USER{
|
|
|
|
|
char name[32];
|
|
|
|
|
char name_loss[32];
|
|
|
|
|
char password[32];
|
|
|
|
|
double account_balance;
|
|
|
|
|
}user[1000];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void releace_reporting_loss();//<2F><><EFBFBD><EFBFBD> <09><>С<EFBFBD><D0A1>
|
|
|
|
|
void keeper_enter(); //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤ <20><>С<EFBFBD><D0A1>
|
|
|
|
|
void withdraw_money(); //ȡǮ ŷ<><C5B7>
|
|
|
|
|
void save_money(); //<2F><>Ǯ ŷ<><C5B7>
|
|
|
|
|
void user_account(); //<2F><><EFBFBD><EFBFBD> <20><>С<EFBFBD><D0A1>
|
|
|
|
|
void user_registration(); //<2F><><EFBFBD><EFBFBD> ŷ<><C5B7>
|
|
|
|
|
void reporting_loss(); //<2F><>ʧ <20><>С<EFBFBD><D0A1>
|
|
|
|
|
void user_find(); //<2F>û<EFBFBD><C3BB><EFBFBD>ѯ ŷ<><C5B7>
|
|
|
|
|
void user_total(); //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> <20><>С<EFBFBD><D0A1>
|
|
|
|
|
void transfer(); //ת<><D7AA> ŷ<><C5B7>
|
|
|
|
|
void exit_(); //<2F>˳<EFBFBD> ŷ<><C5B7>
|
|
|
|
|
void user_feedback(); //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> <20><>С<EFBFBD><D0A1>
|
|
|
|
|
int user_name_vf(); //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>֤ ŷ<><C5B7>
|
|
|
|
|
int user_password_vf(int); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤ ŷ<><C5B7>
|
|
|
|
|
int reporting_loss_vf(int); //<2F><>ʧ<EFBFBD><CAA7>֤ <20><>С<EFBFBD><D0A1>
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
char user_name[1000][32]; //<2F>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
char user_password[1000][32]; // <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char user_name_loss[1000][32];//<2F><>ʧ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
double account_balance[1000]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int user_num=0;//<2F>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
int user_loss_num=0;//<2F><>ʧ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
char feedback_a[1000][1000];
|
|
|
|
|
int feedback_num=0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
keeper_enter();
|
|
|
|
|
int menu=1; //<2F>˵<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
while(menu)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
printf(" **************************************************************** \n");
|
|
|
|
|
printf(" * *\n");
|
|
|
|
|
printf(" * <1> <20><><EFBFBD><EFBFBD> <2> <20><><EFBFBD><EFBFBD> <3> ȡ<><C8A1> *\n");
|
|
|
|
|
printf(" * <4> ת<><D7AA> <5> <20><>ѯ <6> <20><><EFBFBD><EFBFBD> *\n");
|
|
|
|
|
printf(" * <7> <20><>ʧ <8> <20><><EFBFBD><EFBFBD> <0> <20>˳<EFBFBD> *\n");
|
|
|
|
|
printf(" * <9> <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>Ϣ <10> <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> *\n");
|
|
|
|
|
printf(" * *\n");
|
|
|
|
|
printf(" **************************************************************** \n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
scanf("%d",&menu);
|
|
|
|
|
if(menu<0||menu>10)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷѡ<EFBFBD>");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
switch(menu)
|
|
|
|
|
{
|
|
|
|
|
case 1: //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
user_registration();
|
|
|
|
|
break;
|
|
|
|
|
case 2: //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
save_money();
|
|
|
|
|
break;
|
|
|
|
|
case 3: //ȡ<><C8A1>
|
|
|
|
|
withdraw_money();
|
|
|
|
|
break;
|
|
|
|
|
case 4: //ת<><D7AA>
|
|
|
|
|
transfer();
|
|
|
|
|
break;
|
|
|
|
|
case 5: //<2F><>ѯ
|
|
|
|
|
user_find();
|
|
|
|
|
break;
|
|
|
|
|
case 6: //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
user_account();
|
|
|
|
|
break;
|
|
|
|
|
case 7: //<2F><>ʧ
|
|
|
|
|
reporting_loss();
|
|
|
|
|
break;
|
|
|
|
|
case 8: //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
releace_reporting_loss();
|
|
|
|
|
break;
|
|
|
|
|
case 9: //<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>Ϣ
|
|
|
|
|
user_total();
|
|
|
|
|
break;
|
|
|
|
|
case 10: //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
user_feedback();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
void keeper_enter() //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤
|
|
|
|
|
{
|
|
|
|
|
int keeper_enter_pm=1; //<2F><>¼ѭ<C2BC><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char name1[10];
|
|
|
|
|
char password1[20];
|
|
|
|
|
printf("**************<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>**************\n");
|
|
|
|
|
while(keeper_enter_pm)
|
|
|
|
|
{
|
|
|
|
|
if(keeper_enter_pm==1)
|
|
|
|
|
printf(" ********<2A><><EFBFBD>Ƚ<EFBFBD><C8BD>й<EFBFBD><D0B9><EFBFBD>Ա<EFBFBD><D4B1>֤******** \n");
|
|
|
|
|
else
|
|
|
|
|
printf("<EFBFBD>ù<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD><EFBFBD><EFBFBD>֤\n");
|
|
|
|
|
printf("*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",name1);
|
|
|
|
|
printf("*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺") ;
|
|
|
|
|
scanf("%s",password1);
|
|
|
|
|
if(strcmp(name1,"1805")==0&&strcmp(password1,"1805")==0)
|
|
|
|
|
break;
|
|
|
|
|
keeper_enter_pm=2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void user_account() //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int i,n,m;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
m=reporting_loss_vf(i);
|
|
|
|
|
if(m==1)
|
|
|
|
|
m=user_password_vf(i);
|
|
|
|
|
while(m==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("(1)ȷ<><C8B7> <09><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
if(n==2)
|
|
|
|
|
break;
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
for(;i<user_num;i++)
|
|
|
|
|
{
|
|
|
|
|
strcpy(user[i].name,user[i+1].name);
|
|
|
|
|
strcpy(user[i].password,user[i+1].password);
|
|
|
|
|
user[i].account_balance=user[i+1].account_balance;
|
|
|
|
|
}
|
|
|
|
|
user_num--;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
reporting_loss_vf(int i) //<2F><>ʧ<EFBFBD><CAA7>֤
|
|
|
|
|
{
|
|
|
|
|
int j,n;
|
|
|
|
|
for(j=0;j<user_loss_num;j++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(user[i].name,user[j].name_loss)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><EFBFBD>ٽ<EFBFBD><EFBFBD>в<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
n=0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(j==user_loss_num)
|
|
|
|
|
n=1;
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void reporting_loss() //<2F><>ʧ
|
|
|
|
|
{
|
|
|
|
|
int i,n,m;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
m=reporting_loss_vf(i);
|
|
|
|
|
if(m==1)
|
|
|
|
|
m=user_password_vf(i);
|
|
|
|
|
while(m==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("(1)ȷ<><C8B7> <09><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
if(n==2)
|
|
|
|
|
break;
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
strcpy(user[user_loss_num].name_loss,user[i].name);
|
|
|
|
|
user_loss_num++;
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>%s <20><><EFBFBD><EFBFBD>ʧ<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>\n ",user[i].name);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void releace_reporting_loss() //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int i,n,m,j;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
for(j=0;j<user_loss_num;j++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(user[i].name,user[j].name_loss)==0)
|
|
|
|
|
{
|
|
|
|
|
//printf("<22><><EFBFBD>û<EFBFBD><C3BB>Ѿ<EFBFBD><D1BE><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><D2BA>ٽ<EFBFBD><D9BD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
n=0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(n==0)
|
|
|
|
|
n=user_password_vf(i);
|
|
|
|
|
while(n==1)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for(;j<user_loss_num;j++)
|
|
|
|
|
strcpy(user[j].name_loss,user[j+1].name_loss);
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD> <20><>%s <20><> <20>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>ҳɹ<D2B3><C9B9><EFBFBD>\n",user[i].name);
|
|
|
|
|
user_loss_num--;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void user_total() //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
printf("----------------------------------\n");
|
|
|
|
|
for(i=0;i<user_num;i++)
|
|
|
|
|
printf("|<7C>û<EFBFBD><C3BB><EFBFBD>:%6s | <20><><EFBFBD>%6.2f | \n",user[i].name,user[i].account_balance);
|
|
|
|
|
printf("----------------------------------\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int user_name_vf() //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>֤
|
|
|
|
|
{
|
|
|
|
|
int i,j=1;
|
|
|
|
|
char user1_name[32];
|
|
|
|
|
while(j==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",user1_name);
|
|
|
|
|
for(i=0;i<user_num;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(user[i].name,user1_name)==0)
|
|
|
|
|
{
|
|
|
|
|
j=0;
|
|
|
|
|
break;
|
|
|
|
|
//printf("fff");
|
|
|
|
|
}
|
|
|
|
|
if(i==user_num-1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int user_password_vf(int i) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤
|
|
|
|
|
{
|
|
|
|
|
char user1_password[32];
|
|
|
|
|
int m=5;
|
|
|
|
|
while(m--)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%s",user1_password);
|
|
|
|
|
if(strcmp(user[i].password,user1_password)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>½<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\nĿǰ<EFBFBD><EFBFBD><EFBFBD>%.2lf\n",user[i].name,user[i].account_balance);
|
|
|
|
|
break;
|
|
|
|
|
}else{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(m==(-1))
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void user_find() //<2F>û<EFBFBD><C3BB><EFBFBD>ѯ
|
|
|
|
|
{
|
|
|
|
|
int i,n;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
n=reporting_loss_vf(i);
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
n=user_password_vf(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void exit_() //<2F>˳<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void user_registration() //<2F>û<EFBFBD>ע<EFBFBD><D7A2>
|
|
|
|
|
{
|
|
|
|
|
char user1_name[32],user1_password[32],user2_password[32];
|
|
|
|
|
int i,user1_num=user_num,j=0;
|
|
|
|
|
double money;
|
|
|
|
|
while(1){
|
|
|
|
|
j=0;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%s",user1_name);
|
|
|
|
|
for(i=0;i<user_num+1;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(user1_name,user[i].name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD>ڣ<EFBFBD>\n");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
strcpy(user[user_num].name,user1_name);
|
|
|
|
|
|
|
|
|
|
while(j==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%s",user1_password);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%s",user2_password);
|
|
|
|
|
if(strcmp(user1_password,user2_password)!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡\n");
|
|
|
|
|
}else{
|
|
|
|
|
strcpy(user[user_num].password,user1_password);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>óɹ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%lf",&money);
|
|
|
|
|
user[user_num].account_balance=money;
|
|
|
|
|
j=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
user_num++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void save_money() //<2F><>Ǯ
|
|
|
|
|
{
|
|
|
|
|
int i,n;
|
|
|
|
|
double money;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
n=reporting_loss_vf(i);
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
n=user_password_vf(i);
|
|
|
|
|
}
|
|
|
|
|
while(n==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%lf",&money);
|
|
|
|
|
user[i].account_balance=user[i].account_balance+money;
|
|
|
|
|
printf("<EFBFBD>˴δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%.2lf\n",user[i].account_balance);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void withdraw_money() //ȡǮ
|
|
|
|
|
{
|
|
|
|
|
int i,n;
|
|
|
|
|
double money;
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
n=reporting_loss_vf(i);
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
n=user_password_vf(i);
|
|
|
|
|
}
|
|
|
|
|
if(n==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%lf",&money);
|
|
|
|
|
if(money>user[i].account_balance)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ִ˴<EFBFBD>ȡ<EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}else{
|
|
|
|
|
user[i].account_balance=user[i].account_balance-money;
|
|
|
|
|
printf("<EFBFBD>˴<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%.2 lf\n",user[i].account_balance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void user_feedback() //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int menu1,e;
|
|
|
|
|
printf("<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<1><3E><><EFBFBD><EFBFBD> <2><3E><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>ָ<EFBFBD>");
|
|
|
|
|
scanf("%d",&menu1);
|
|
|
|
|
if(menu1==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",feedback_a[feedback_num]);
|
|
|
|
|
feedback_num++;
|
|
|
|
|
}
|
|
|
|
|
if(menu1==2)
|
|
|
|
|
{
|
|
|
|
|
for(e=0;e<feedback_num;e++)
|
|
|
|
|
{
|
|
|
|
|
printf("%d.%s",e+1,feedback_a[e]);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void transfer() //ת<><D7AA>
|
|
|
|
|
{
|
|
|
|
|
int i,n=1,j,s=1,m;
|
|
|
|
|
double f_money;
|
|
|
|
|
char user1_name[32];
|
|
|
|
|
i=user_name_vf();
|
|
|
|
|
m=reporting_loss_vf(i);
|
|
|
|
|
if(m==1)
|
|
|
|
|
m=user_password_vf(i);
|
|
|
|
|
while(m==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",user1_name);
|
|
|
|
|
for(j=0;j<user_num;j++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(user[j].name,user1_name)==0)
|
|
|
|
|
{
|
|
|
|
|
m=2;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(j==user_num)
|
|
|
|
|
printf("Ŀ<EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣\n");
|
|
|
|
|
}
|
|
|
|
|
while(m==2)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>˽<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%lf",&f_money);
|
|
|
|
|
if(f_money<=user[i].account_balance)
|
|
|
|
|
{
|
|
|
|
|
user[i].account_balance=user[i].account_balance-f_money;
|
|
|
|
|
user[j].account_balance=user[j].account_balance+f_money;
|
|
|
|
|
printf("ת<EFBFBD>˳ɹ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD> %.2f\n",user[i].account_balance);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|