自动取款机源代码(c and c )

上传人:kms****20 文档编号:41199684 上传时间:2018-05-28 格式:DOC 页数:27 大小:64KB
返回 下载 相关 举报
自动取款机源代码(c and c  )_第1页
第1页 / 共27页
自动取款机源代码(c and c  )_第2页
第2页 / 共27页
自动取款机源代码(c and c  )_第3页
第3页 / 共27页
自动取款机源代码(c and c  )_第4页
第4页 / 共27页
自动取款机源代码(c and c  )_第5页
第5页 / 共27页
点击查看更多>>
资源描述

《自动取款机源代码(c and c )》由会员分享,可在线阅读,更多相关《自动取款机源代码(c and c )(27页珍藏版)》请在金锄头文库上搜索。

1、自动取款机源代码自动取款机源代码(C(C andand C C ) )自动取款机源代码(C and C+).txt 和英俊的男人握握手,和深刻的男人谈谈心,和成功的男人多交流,和普通的男人过日子。#include #include #include #include #include #include struct Acountchar name20;int cardnu;int code;double Ban;char time26;struct Acount user;int i;void Welcome()coutn“n“:“;char *_time ()time_t rawtime;s

2、truct tm * timeinfo;time ( timeinfo = localtime ( return asctime (timeinfo); int find(int card) i=-1;ifstream in(“acount.dat“,ios:binary|ios:nocreate);if(!in)return 0;while(!in.eof() i+;in.read(char * )if(user.cardnu=card)in.close();return 1;in.close();return 0;int cardnumber2()int n;fstream file(“账

3、号.dat“,ios:binary|ios:nocreate|ios:in|ios:out);if(!file)cout0)coutTem;user.Ban+=Tem;fstream out(“acount.dat“,ios:in|ios:out|ios:binary);out.seekp(i*sizeof(user),ios:beg);out.write(char*)out.close(); coutch;if(ch=y|ch=Y)print2(Tem); void Drawmoney2() char ch;int Tem;coutTem;while(Tem%100)coutTem;user

4、.Ban-=Tem;fstream out(“acount.dat“,ios:in|ios:out|ios:binary);out.seekp(i*sizeof(user),ios:beg);out.write(char*)out.close();coutch;if(ch=y|ch=Y)print2(-Tem); void Change2()int tem,j=3;couttem;j-;if(tem=user.code)couttem;user.code=tem;fstream out(“acount.dat“,ios:binary|ios:in|ios:out);out.seekp(i*si

5、zeof(user),ios:beg);out.write(char*)out.close();coutcode;if(user.code=code)break;elsecout :“;docinchoice;switch(choice)case 1: Saving2(); break; case 2: Drawmoney2(); break;case 3: cout5|choicetem;if(tem=0)break;elseif(find(tem)=0)coutch;if(ch!=F|ch=f)break; else Select2();while(1);void Management2(

6、)int choice;cout:“;docinchoice;if(choice=2)return ;else if(choice=1)ofstream out(“acount.dat“,ios:binary|ios:app);coutuser.name;user.cardnu=cardnumber2();coutn;if(n999999)cout999999);user.code=n;user.Ban=10.0;strcpy(user.time,_time();out.write(char *) out.close();coutch;if(ch=y|ch=Y)print2();cout0)c

7、outTem;user.Ban+=Tem;fstream out(“acount.dat“,ios:in|ios:out|ios:binary);out.seekp(i*sizeof(user),ios:beg);out.write(char*)out.close(); coutch;if(ch=y|ch=Y)print1(Tem); void Drawmoney1() char ch;int Tem;coutTem;while(Tem%100)coutTem;user.Ban-=Tem;fstream out(“acount.dat“,ios:in|ios:out|ios:binary);o

8、ut.seekp(i*sizeof(user),ios:beg);out.write(char*)out.close();coutch;if(ch=y|ch=Y)print1(-Tem); void Change1()int tem,j=3;couttem;j-;if(tem=user.code)couttem;user.code=tem;fstream out(“acount.dat“,ios:in|ios:out|ios:binary);out.seekp(i*sizeof(user),ios:beg);out.write(char*)out.close();coutcode;if(use

9、r.code=code)break;elsecout :“;docinchoice;switch(choice)case 1: Saving1(); break; case 2: Drawmoney1(); break;case 3: cout5|choiceuser.cardnu;if(user.cardnu=0)break;elseif(find(user.cardnu)=0)coutch;if(ch!=F|ch=f)break; else Select1();while(1);void Management1()int choice;cout:“;docinchoice;if(choic

10、e=2)return ;else if(choice=1)ofstream out(“acount.dat“,ios:binary|ios:app);coutuser.name;user.cardnu=cardnumber1();coutn;if(n999999)cout999999);user.code=n;user.Ban=10.0;strcpy(user.time,_time();out.write(char *) out.close();coutch;if(ch=y|ch=Y)print1();cout:“;docinchoice;switch(choice)case 1 : Tell

11、erMach2(); break;case 2 : Management2(); break;case 3 : cout:“;docinchoice;switch(choice)case 1 : TellerMach1(); break;case 2 : Management1(); break;case 3 : coutchoice;if(choice=3)break;else if(choice=1)English();else if(choice=2)Chinese();else cout“输入错误,请重新输入 :“;while(choice!=1system(“cls“);cout“nnnnttt 非常感谢你的使用!n“endl;cout“按任意键结束“;cin.get();cin.get();return 0;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号