欢迎来到天天文库
浏览记录
ID:47426062
大小:87.01 KB
页数:16页
时间:2020-01-10
《ATMC语言编程源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include/*引用库函数*/#include#include#include#include#defineZHANGHUSHU10#defineJIAOYISHU20intcaidan();/*登录注册菜单*/voidzhuce();voiddenglu();voidbaocunshuju();intmenu();/*主菜单*/voidcunkuan();voidqukuan();voidzhuanzhang();voi
2、dchaxun();voidxiugaimima();structJiaoYi/*定义交易结构体*/{charshijian[50];/*时间*/charleixing[3];/*类型*/floatjine;/*金额*/floatyue;/*余额*/};structZhangHu/*定义账户结构体*/{charxingming[17];/*姓名*/charzhanghao[12];/*账号*/charshenfenzheng[19];/*身份证*/charmima[7];/*密码*/floatyue;/*余额*/st
3、ructJiaoYijiaoyi[JIAOYISHU];/*在账户的结构体中在定义交易的结构体*/intjiaoyishu;};structZhangHuzhanghu[ZHANGHUSHU];/*定义账户数来确定账户这一结构体中有多少个体*/intj;/*当前账户*/intzhanghushu;intk;/*交易帐号*/intjiaoyishu;voidxianshizhanghu();intcaidan()/*菜单函数*/{charc;do{system("cls");/*每次选择运行前清屏*/printf("
4、tt=================欢迎使用ATM系统===============");/*菜单选择*/printf("tt*1.注册**");printf("tt*2.登录*");printf("tt*3.保存数据*");printf("tt*0.退出*");printf("tt===============================================");printf("ttt请作出选择(0-3):");c=getchar();/*读
5、入选择*/}while(c<'0'
6、
7、c>'3');return(c-'0');/*c变为空后返回重新选择*/}/*根据主菜单的返回值来确定主函数的值*/voidzhuce(){printf("tt请输入姓名:");scanf("%s",zhanghu[zhanghushu].xingming);printf("tt请输入帐号:");scanf("%s",zhanghu[zhanghushu].zhanghao);do{printf("tt请输入身份证:");scanf("%s",zhangh
8、u[zhanghushu].shenfenzheng);if(strlen(zhanghu[zhanghushu].shenfenzheng)==18)break;elseprintf("tt身份证必须是18,请重新输入!");}while(1);do{printf("tt请输入密码:");scanf("%s",zhanghu[zhanghushu].mima);if(strlen(zhanghu[zhanghushu].mima)==6)break;elseprintf("tt密码必须是6位
9、,请重新输入!");}while(1);zhanghu[zhanghushu].yue=0;zhanghu[zhanghushu].jiaoyishu=0;zhanghushu++;xianshizhanghu();}voidxianshizhanghu()/*显示账户函数来显示所输入的账户*/{inti;for(i=0;i10、[i].zhanghao,zhanghu[i].xingming,zhanghu[i].shenfenzheng,zhanghu[i].mima,zhanghu[i].yue);system("pause");}}voiddenglu()/*登录函数*/{charzhanghao[12],mima[7];inti=0;intmimacishu=
10、[i].zhanghao,zhanghu[i].xingming,zhanghu[i].shenfenzheng,zhanghu[i].mima,zhanghu[i].yue);system("pause");}}voiddenglu()/*登录函数*/{charzhanghao[12],mima[7];inti=0;intmimacishu=
此文档下载收益归作者所有