#include <stdio.h>voidMain () {inti,j; intCode=0, flag=0; intchoice1=0, choice2=0, choice3=0; intrmb=100000, wb=100000; intcash1=0, cash2=0; Charinstruct='N'; printf ("************************************************************\n"); printf ("* *\n"); printf ("* Welcome to the Blue Shit ATM cash machine *\n"); printf ("* *\n"); printf ("* Version number:1.0.1 *\n"); printf ("* *\n"); printf ("************************************************************\n"); printf ("Please type your password: \ n"); for(i=0;i<3; i++) {scanf ("%d",&code); System ("CLS"); if(code==9527) { Break; } if(code!=9527) {printf ("Wrong password! Please enter again: \ n"); Flag+=1; } } if(flag==3) {printf ("your password input error 3 times, please go to blue shit consulting! "); return; } while(instruct=='N'|| instruct=='N' ) { if(code==9527) {printf ("Welcome back, Mr. Xu! \ n"); printf ("1. Check the balance 2. Withdrawal 3. Exit"); scanf ("%d",&Choice1); System ("CLS"); Switch(Choice1) { Case 1:p rintf ("1. RMB 2. Foreign currency"); scanf ("%d",&Choice2); System ("CLS"); Switch(choice2) { Case 1:p rintf ("your RMB account balance: ¥%d\n", RMB); Break; Case 2:p rintf ("your foreign currency account balance: $%d\n", WB); Break; } Break; Case 2:p rintf ("1. RMB 2. Foreign currency"); scanf ("%d",&choice3); System ("CLS"); Switch(choice3) { Case 1:p rintf ("Please enter the withdrawal amount: \ n"); scanf ("%d",&cash1); RMB=rmb-Cash1; printf ("your account balance: ¥%d\n", RMB); Break; Case 2:p rintf ("Please enter the withdrawal amount: \ n"); scanf ("%d",&CASH2); WB=wb-Cash2; printf ("your account balance: $%d\n", WB); Break; } Break; Case 3: Break; } printf ("whether to exit the program <y indicates yes, n means no;:"); scanf ("%s",&instruct); } }}
820 C Language Jobs