1、ATM 银行自动取款机 C 程序:#include “stdio.h“#include “stdlib.h“#include “conio.h“char a;void LanguageMeun()system(“cls“);printf(“=n“); /选择中英文printf(“| 1.中文 |n“);printf(“| 2.English |n“);printf(“| 3.退出Exit |n“);printf(“=n“);void MainMeun(char a)switch(a)case 1:system(“cls“);printf(“=n“);printf(“| 1.查询 |n“);pr
2、intf(“| 2.存钱 |n“);printf(“| 3.取钱 |n“);printf(“| 4.退出 |n“);printf(“=n“);break; /主菜单case 2:system(“cls“);printf(“=n“);printf(“| 1.Query |n“);printf(“| 2.Deposit |n“);printf(“| 3.Withdraw |n“);printf(“| 4.Exit |n“);printf(“=n“);break;case 3:system(“cls“);return;void Query(float n)char ch;switch(a)case
3、1:system(“cls“);printf(“=n“);printf(“此用户有 %fn“,n);printf(“按任意键继续n“);printf(“=n“);ch=getch();break;case 2:system(“cls“);printf(“=n“);printf(“you have %fn“,n);printf(“press any key for continuen“);printf(“=n“); ch=getch();break;float Deposit(float n) /存钱函数float add;char ch;switch(a)case 1:system(“cls“
4、);printf(“=n“);printf(“输入您要存的数目n“);scanf(“%f“,printf(“按任意键继续n“);printf(“=n“);ch=getch();break;case 2:system(“cls“);printf(“=n“);printf(“how much you want countn“);scanf(“%f“,printf(“press any key for continuen“);printf(“=n“);ch=getch();break;return n+add;float Withdraw(float n)float i;char ch;switch
5、(a)case 1:system(“cls“);printf(“=n“);printf(“输入您要取的数目 n“);scanf(“%f“,if(in)printf(“您的余额不足,请充值n“);printf(“按任意键继续n“);printf(“=n“);ch=getch();break; /余额不足判断case 2:system(“cls“);printf(“=n“);printf(“how much you want taken“);scanf(“%f“,if(in)printf(“the extre money is lackn“);printf(“press any key for c
6、ontinuen“);printf(“=n“);ch=getch();break;if(in)return n;elsereturn n-i;void main()char x;float money=1000.0;LanguageMeun();a=getch();MainMeun(a);doMainMeun(a);x=getch();switch(x)case 1:Query(money);break;case 2:money=Deposit(money);break; / 主菜单 case 选择case 3:money=Withdraw(money);break;case 4:return;default: break;while(1);