#include<stdio.h>
#include<stdlib.h>
int main(void){
char zhangHao[]="123";
int miMa=456;
int money=100;
int num;
printf("************************\n");
printf("********老板再来啊...*****\n");
printf("*************************\n");
 char inputZH[20];
 int inputMM;
 int inputMoney;
 int i=0;
 do{
 fflush(stdin);
 printf("\n请输入您的账号:");
 scanf("%s",&inputZH);
 printf("\n请输入您的密码:");
 fflush(stdin);
 scanf("%s",&inputMM);
 if(strcmp(inputZH,zhangHao)==0&&inputMM){
  printf("输入正确,欢迎光临...\n");
  break;
 }else{
 if(i==2){
 //退出程序
 printf("三次输入失败,退卡中...\n");
 exit(0);}
 else{
  printf("\n输入错误,请重新输入...");
 i++;
 continue;
 }
 }
 }while(i<3);
 for(i=0;i>=0;i++){
 printf("\n请选择您所需要的服务:1.查询 2.存钱 3.取款  4.退卡\n");
 scanf("%d",&num);
 switch(num){
 case 1:printf("\n您的余额为:%d",money);
 continue;
 case 2:{
 int k;
 for(k=0;k>=0;k++){
 //存入的金额
 printf("\n请输入您想存入的金额:");
 scanf("%d",&inputMoney);
 if(inputMoney%100==0){
 money+=inputMoney;
 printf("存钱成功,您的余额为%d",money);
 break;
 }else{
 printf("\n存入失败,请放入100的倍数的真钞\n");
 continue;
 }
 }
 continue;
 }
 case 3:{
 int q;
 for(q=0;q>=0;q++){
 //取出的金额
 printf("\n请输入您想取出的金额:");
 scanf("%d",&inputMoney);
  if(inputMoney%100==0){
  money-=inputMoney;
  printf("取款成功,您的余额为:%d\n",money);
  break;
  } else{
  printf("\n您的余额不足,取款失败\n");
  continue;
  }
 }
 break;
 }
 case 4:printf("\n退卡中...");
 exit(0);
 default :printf("\n选择错误,请重新选择!...");
 continue;
 }
 }
 }

ATM机(非函数版)的更多相关文章

  1. 用java实现一个ATM机系统(2.0版)

    用java实现一个ATM机系统(2.0版) java实现银行ATM自助取款机,实现功能:用户登录.余额查询.存钱.取钱.转账.修改密码.退出系统. 文章目录 用java实现一个ATM机系统(2.0版) ...

  2. [C++]竞赛模板·数据统计与IO(重定向版与非重定向版)

      /* 数据统计与IO 重定向版模板 描述:本机测试用文件数据流重定向,一旦提交到比赛就自动“删除”重定向语句 */ # define LOCAL #include<stdio.h> # ...

  3. ATM机模拟系统

    实验要求 https://pan.baidu.com/s/1Sq5joWyVsNhY8DYiyI4UmQ 源代码 /*信1705-1 20173458 王嘉梁*/ package atm; impor ...

  4. python实现atm机基本操作及购物车

    一.需求分析 ATM机要为用户提供转账,提现,还款,付款,消费流水,操作记录等操作接口 ATM机要为管理员提供创建用户,冻结解冻,修改额度的功能 ATM机管理员认证使用装饰器来实现 购物车要提供管理员 ...

  5. 多用户ATM机(面向对象编程)

    let readline = require('readline-sync'); // 清屏函数 let clear = () => process.stdout.write(process.p ...

  6. 模块购物商城和ATM机代码:

    http://outofmemory.cn/python/video/let-us-python/ python为程序员服务  快来加入群[python爬虫交流群](群号570070796),发现精彩 ...

  7. 29-ESP8266 SDK开发基础入门篇--编写TCP 客户端程序(Lwip RAW模式,非RTOS版,精简入门)

    https://www.cnblogs.com/yangfengwu/p/11456667.html 由于上一节的源码长时间以后会自动断开,所以再做这一版非RTOS版的,咱直接用lua源码里面别人写的 ...

  8. 用python实现自己的http服务器——多进程、多线程、协程、单进程非堵塞版、epoll版

    了解http协议 http请求头 GET / HTTP/1.1 Host: www.baidu.com Connection: keep-alive Pragma: no-cache Cache-Co ...

  9. 1.4 面试问题整理: ATM机取款

    流程图:

随机推荐

  1. API Copy Big FIles

    public class ApiCopyFile { private const int FO_COPY = 0x0002; private const int FOF_ALLOWUNDO = 0x0 ...

  2. C实现头插法和尾插法来构建单链表(不带头结点)

    链表的构建事实上也就是不断插入节点的过程.而节点的插入能够分为头插法和尾插法. 头插法就是在头结点后插入该节点,始终把该节点作为第一个节点.尾插法就是在链表的最后一个节点处插入元素,作为最后一个节点. ...

  3. the first week study

    1.In 1989, a man named Guido create "python" as a kind of computer languages. And now we u ...

  4. Evaluate Reverse Polish Notation --leetcode

    原题链接:https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ 题目大意:给出逆波兰式,然后求其结果. 解题方法:单个栈 ...

  5. android编程取消标题栏方法(appcompat_v7、Theme.NoTitleBar)

    方式一:编码方式 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstance ...

  6. bzoj 4543 HOTEL 加强版

    题目大意: 求树上取三个点这三个点两两距离相等的方案数 思路: 远古时候的$n^2$做法是换根 但那样无法继续优化了 学习了一波长链剖分 考虑如何在一棵树上进行dp 设$f[i][j]$表示以$i$为 ...

  7. BZOJ_3209_花神的数论题_组合数+数位DP

    BZOJ_3209_花神的数论题_组合数+数位DP Description 背景 众所周知,花神多年来凭借无边的神力狂虐各大 OJ.OI.CF.TC …… 当然也包括 CH 啦. 描述 话说花神这天又 ...

  8. 【HAOI 2015】 树上操作

    [题目链接] 点击打开链接 [算法] 树链剖分 子树的DFS序是连续的一段! [代码] #include<bits/stdc++.h> using namespace std; #defi ...

  9. yum: Cannot find a valid baseurl for repo: migsrv解决方法

    yum安装程序报错: Loaded plugins: fastestmirror Setting up Update Process Determining fastest mirrors Could ...

  10. bzoj1138

    dp+spfa优化 最朴素的dp是dp[i][j]表示i->j的最短路,然后把所有pair(i,i)放到队列里跑spfa,但是这样被卡掉了,那么我们要优化一下 问题在于每次我们转移的时候要枚举i ...