中级守护
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<windows.h>
#include<fstream>
#include<iomanip>
#include<conio.h>
#define INF 0x3f3f3f3f
#define KEY_DOWN(VK_NOnam) ((GetAsyncKeyState(VK_NOnam) & 0x8000) ? 1:0)
using namespace std;
int jb=100;
int x;
void CZDL_JGD(int o){
for(int i=1;i<=4;i++){
system("cls");
cout<<"**中";
for(int i=1;i<=3;i++){
Sleep(500);
cout<<".";
}
}
}
int main(){
int q;
char czsl;
double a,b,d,e;
char c;
char linw,t;
string s,s1,g,n,k="20110304",k2="GC";
double p=1*1.0;
cout<<"输入账号(账号:GC):";
getline(cin,s1);
if(s1==k2){
cout<<"输入密码(密码:20110304):";
getline(cin,s);
if(s==k){
system("cls");
cout<<"欢迎";
Sleep(1000);
while(t!='#'){
system("cls");
cout<<" "<<"计算器"<<p<<"\n";
cout<<" "<<"A 开始\n";
cout<<" "<<"B 使用方法\n";
cout<<" "<<"C **\n";
cout<<" "<<"D 查看余额\n";
cout<<" "<<"E 更新版本\n";
cout<<" "<<"F 小游戏(不要玩)\n";
cout<<" "<<"# 退出(恢复出厂设置)\n";
cin>>t;
if(t=='A'||t=='a'){
if(jb>=20){
jb-=20;
system("cls");
while(c!='S'||c!='s'){
system("cls");
cin>>a>>linw>>b;
if(linw=='+'){
cout<<a+b;
}else if(linw=='-'){
cout<<a-b;
}else if(linw=='*'){
cout<<a*b;
}else if(linw=='/'){
if(b==0){
cout<<"NO";
}else{
cout<<a/b;
}
}
cout<<endl<<"是否退出 S是 F否"<<endl;
cin>>c;
if(c=='S'){
break;
}else{
continue;
}
}
}else{
system("cls");
cout<<"金币不够!";
Sleep(1000);
continue;
}
} else if(t=='B'){
system("cls");
cout<<"此计算只能计算1道算式 例如:1+2 5*3 7+7 不能计算多道算式 例如:2*3+2 2+1+3 5/2.5*2";
Sleep(5000);
continue;
}
else if(t=='C'){
system("cls");
cout<<"请输入充多少元 A 10 B 50 C 100 D 500 E 1000 不输入或其他=退出\n";
cin>>czsl;
if(czsl=='A'){
system("cls");
CZDL_JGD(10);
system("cls");
jb+=10;
cout<<"**成功,充了"<<10<<"元,你还有"<<jb<<"元";
Sleep(1000);
}else if(czsl=='B'){
system("cls");
CZDL_JGD(50);
system("cls");
jb+=50;
cout<<"**成功,充了"<<50<<"元,你还有"<<jb<<"元";
Sleep(1000);
}else if(czsl=='C'){
system("cls");
CZDL_JGD(100);
system("cls");
jb+=100;
cout<<"**成功,充了"<<100<<"元,你还有"<<jb<<"元";
Sleep(1000);
}else if(czsl=='D'){
system("cls");
CZDL_JGD(500);
system("cls");
jb+=500;
cout<<"**成功,充了"<<500<<"元,你还有"<<jb<<"元";
Sleep(500);
}else if(czsl=='E'){
system("cls");
CZDL_JGD(1000);
system("cls");
jb+=1000;
cout<<"**成功,充了"<<1000<<"元,你还有"<<jb<<"元";
Sleep(1000);
}else{
system("cls");
continue;
}
continue;
}else if(t=='D'||t=='d'){
system("cls");
cout<<"你还有"<<jb<<"元";
Sleep(2000);
continue;
}else if(t=='E'||t=='e'){
q=0;
for(int i=1;i<=100;i++){
q++;
system("cls");
cout<<"更新中%"<<q;
Sleep(30);
}
system("cls");
p=p+0.1;
cout<<"更新成功,版本升级为"<<p;
}else if(t=='F'||t=='f'){
system("cls");
cout<<"欢迎";
Sleep(200);
cout<<"来到";
Sleep(200);
cout<<"小游";
Sleep(200);
cout<<"戏界面";
Sleep(1000);
system("cls");
cout<<"1.我是计算能手\n";
cout<<"2.未**\n";
cout<<"3.未**\n";
cout<<"4.未**\n";
cout<<"5.未**\n";
cin>>x;
if(x==1){
cout<<"请问2*52+321-21*-1=?";
}else{
continue;
}
}
else/* if(t=='#')*/{
cout<<"欢迎下次使用";
continue;
}
}
}else{
cout<<"密码错误";
}
}else{
cout<<"账号错误";
}
return 0;
}