01./*
02.*程序的版权和版本声明部分:
03.*Copyright(c)2013,烟台大学计算机学院学生
04.*All rights reserved.
05.*文件名称:
06.*作者:张立锋
07.*完成日期:2013年11月14日
08.*版本号:v1.0
09.*对任务及求解方法的描述部分:
10.*输入描述:
11.*问题描述:银行系统
12.*程序输出:
13.*问题分析:
14.*算法设计:
15.*/
#include <iostream>
using namespace std;
const int Password=13357;
int main()
{
int num,a,b,c=1234567,d,f;
cout<<"欢迎来到张氏银行"<<endl;
cout<<"请输入你的密码,快点啊!"<<endl;
cin>>num;
while(num!=13357)
{
cout<<"仔细想一想,请再次输入!";
cin>>num;
}
if(num==Password)
{
while(true)
{
cout<<"输入正确,欢迎选择以下业务"<<endl;
cout<<"1,查询"<<endl;
cout<<"2,取款"<<endl;
cout<<"3,存款"<<endl;
cout<<"4,转账"<<endl;
cout<<"0,退出"<<endl;
cout<<"请输入0-4"<<endl;
cin>>a;
switch(a)
{
case 1:cout<<"你的存款余额是1234567"<<endl;
break;
case 2:cout<<"请输入你的取款金额"<<endl;
cin>>b;
cout<<"你的账户余额是"<<1234567-b<<"RMB"<<endl;
break;
case 3:cout<<"输入你的存款金额"<<endl;
cin>>d;
cout<<"你的账户余额是"<<c+d<<"RMB"<<endl;
break;
case 4:cout<<"请输入你的转账金额";
cin>>f;
cout<<"你的账户余额是"<<c-f<<"RMB"<<endl;
break;
default:
cout<<"请重新输入"<<endl;
break;
}
}
}
return 0;
}
运行结果
心得体会
很爽