#include <stdio.h>
void main()
{
int i,j;
int code=0,flag=0;
int choice1=0,choice2=0,choice3=0;
int RMB=100000,WB=100000;
int cash1=0,cash2=0;
char instruct='n';
printf("************************************************************\n");
printf("* *\n");
printf("* 欢迎使用blue shit ATM取款机 *\n");
printf("* *\n");
printf("* version number:1.0.1 *\n");
printf("* *\n");
printf("************************************************************\n");
printf("请键入您的密码:\n");
for(i=0;i<3;i++)
{
scanf("%d",&code);
system("cls");
if(code==9527)
{
break;
}
if(code!=9527)
{
printf("密码有误!请再次输入:\n");
flag+=1;
}
}
if(flag==3)
{
printf("您的密码输入错误3次,请到blue shit咨询!");
return;
}
while(instruct=='N'|| instruct=='n' )
{
if(code==9527)
{
printf("徐先生,欢迎回来!\n");
printf("1.查询余额 2.取款 3.退出");
scanf("%d",&choice1);
system("cls");
switch(choice1)
{
case 1:printf("1.人民币 2.外币");
scanf("%d",&choice2);
system("cls");
switch(choice2)
{
case 1:printf("您的人民币账户余额:¥%d\n",RMB);
break;
case 2:printf("您的外币账户余额:$%d\n",WB);
break;
}
break;
case 2:printf("1.人民币 2.外币");
scanf("%d",&choice3);
system("cls");
switch(choice3)
{
case 1:printf("请输入取款额度:\n");
scanf("%d",&cash1);
RMB=RMB-cash1;
printf("您的账户余额:¥%d\n",RMB);
break;
case 2:printf("请输入取款额度:\n");
scanf("%d",&cash2);
WB=WB-cash2;
printf("您的账户余额:$%d\n",WB);
break;
}
break;
case 3:
break;
}
printf("是否退出程序<y表示是,n表示否>:");
scanf("%s",&instruct);
}
}
}