void referCard(int *a,int *b);
void refersecret(int *a,int i);
int main(void)
{
int idCard[5] = {111,222,333,444,555};
int secretCard[5] = {11,22,33,44,55};
referCard(idCard,secretCard);
return 0;
}
//密码查询
void refersecret(int *a,int i)
{
int secret=0,num=0,num_1=0;
do{
printf("请输入您的密码:");
scanf("%d",&secret);
if(secret==a[i]){
do{
printf("请输入取钱数额(100-50000,100元面值。):");
scanf("%d",&num);
if (num<100||num>50000||num%100!=0) {
printf("输入有误! ");
}
}while(num<100||num>50000||num%100!=0);
printf("请取钱! ");
break;
}else{
num_1++;
}
if (num_1==3) {
printf("您的银行卡已被冻结,24小时之后解锁! ");
break;
}
}while(1);
}
//卡号查询比较
void referCard(int *a,int *b)
{
int id=0,i=0,choice=0;
bool m=0;
do{
printf("请选择您要执行的操作: 取款请输入1 查询请输入2 转账请输入3 存款请输入4 ");
scanf("%d",&choice);
if (choice!=1) {
printf("该功能在未开通,请重新输入!");
}
}while(choice!=1);
do{
printf("请输入您的卡号:");
scanf("%d",&id);
for (; i<6; i++) {
if (a[i]==id) {
m=1;
break;
}
if (i==5) {
printf("卡号输入错误! ");
}
}
}while(m==0);
refersecret(b,i);
}