资源描述:
《ATM自动取款机C语言源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、//ATM自动取款机C语言源代码#include#includevoidmain(){intchoice(intn,intmoney);intbalance=1000000;intpassword,m=0;intn=0;printf("");printf("欢迎使用ATM自动取款机!");printf("welcometothissystem");printf("按回车键继续");printf("pressEntertocontinue");g
2、etchar();system("cls");do{if(n==0){printf("");printf("请输入您的密码");printf("pleaseinputyourpassword");}else{printf("您输入的密码有误,请重新输入:");printf("Thepasswordiswrong,pleaseinputagain:");}scanf("%d",&password);n++;}while(password!=123456&&n!=3);system("
3、cls");if(password==123456)do{printf("");printf("欢迎使用ATM自动取款机!");printf("welcometothissystemofATM!");printf("********************************");printf("1.取款DebitWithdrawal");printf("2.存款CreditDeposit");printf("3.余额查询Seek");printf("4.退出Exit"
4、);printf("********************************");choice(m,balance);printf("继续请输入Y");printf("Ifyouwanttocontinue,PressY");getchar();}while(getchar()=='Y');else{printf("");printf("您好,由于您三次输入密码有误,我们将没收您的卡,请您在一周内持有效证件于银行办理取卡手续.");printf("yourpasswordisw
5、rong,wewillsequestrateyoucard,pleasetakeyoueffectivepaperscometobankgetyourcardback");}}intchoice(intn,intmoney){intm=0;staticintflag=1000000;printf("请输入你的选择");printf("pleasechoice:");scanf("%d",&n);system("cls");if(n==1){printf("");printf("请输入取款金
6、额:");printf("pleaseinputwhatyouwanttodebit:");scanf("%d",&m);flag=flag-m;printf("");printf("请稍后...");printf("pleasewait...");printf("您的余额为balance:%d",flag);printf("交易成功!");printf("thetransactionsucceed!");}elseif(n==2){printf("请输入您要存入的金额:");printf
7、("pleaseinputwhatyouwanttocredit:");scanf("%d",&m);flag=flag+m;printf("");printf("请稍后...");printf("pleasewait...");printf("您的余额为balance:%d",flag);printf("交易成功!");printf("thetransactionsucceed!");}elseif(n==3){printf("请稍后...");printf("pleasewait.
8、..");printf("您的余额为balance:%d元",flag);}elseif(n==4){printf("请取卡,谢谢使用!");printf("pleasetakeyoucard!");}else