账号:xunlianying
密码:81918
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int sum = 0, MIMA = 81918;
int x, t, mima, summ;
int g = 2000, h = 1500;
string ZHANGHU= "xunlianying";
bool denglu(string zhanghu, int mima){
if(zhanghu == ZHANGHU){
if(mima == MIMA){
cout << "登陆成功!";
Sleep(g);
system("cls");
cout << "欢迎来到数学训练营" << endl << endl;
Sleep(g);
cout << "这里是成功开始的地方" << endl << endl;
Sleep(g);
cout << "加油吧同学们!" << endl;
Sleep(g);
system("cls");
return 1;
}else{
cout << "密码错误!" << endl << endl;
return 0;
}
}else{
cout << "账户错误!" << endl << endl;
return 0;
}
}
int suanshi(int t){
int a = rand() % 50;
int b = rand() % 50;
char c = rand() % 3 + 1;
if(c == 1) c = '+';
else if(c == 2) c = '-';
else c = '*';
cout << a << " " << c << " " << b << " " << '=' << " ";
cin >> x;
if(c == '+'){
if(x == a + b){
cout << "对" << endl;
sum += 10;
}else{
cout << "错" << endl;
cout << "答案是" << a + b << endl;
}
Sleep(h);
system("cls");
}else if(c == '-'){
if(x == a - b){
cout << "对" << endl;
sum += 10;
}else{
cout << "错" << endl;
cout << "答案是" << a - b << endl;
}
Sleep(h);
system("cls");
}else{
if(x == a * b){
cout << "对" << endl;
sum += 10;
}else{
cout << "错" << endl;
cout << "答案是" << a * b << endl;
}
Sleep(h);
system("cls");
}
return 0;
}
int dengji(int summ){
if(summ <= 100){
system("color EA");
cout << "青铜" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ <= 500){
system("color EF");
cout << "白银" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ <= 1000){
system("color E6");
cout << "黄金" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ <= 5000){
system("color EC");
cout << "钻石" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ <= 10000){
system("color CE");
cout << "王者" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ <= 50000){
system("color E4");
cout << "枭雄" << endl;
Sleep(g);
system("pause");
return 0;
}else if(summ > 50000){
system("color E5");
cout << "天之骄子" << endl;
Sleep(g);
system("pause");
return 0;
}
}
int main(){
bool l;
string zhanghu;
system("color EA");
for(int i = 1; i >= 1; i++){
cout << "请输入账户:";
cin >> zhanghu;
cout << endl;
cout << "请输入密码:";
cin >> mima;
cout << endl;
if(denglu(zhanghu, mima) == 1){
break;
}
system("cls");
}
for(int i = 1; i >= 1; i++){
for(int j = 1; j <= 10; j++){
suanshi(t);
}
cout << "本次你获得了" << sum << "分!" << endl;
Sleep(h);
switch(sum){
case 100:
case 90:cout << "你真棒!" << endl; break;
case 70:
case 60:
case 50:
case 40:cout << "继续努力!" << endl; break;
case 30:
case 20:
case 10:
case 0:cout << "要加油了!" << endl; break;
}
Sleep(h);
summ += sum;
sum = 0;
cout << "你的总分:" << summ << endl;
Sleep(h);
dengji(summ);
system("cls");
system("color EA");
cout << "再来一次?(是的话输入1,不是输入0)";
cin >> l;
if(l){
sum = 0;
system("cls");
Sleep(g);
continue;
}else{
break;
}
}
system("pause");
return 0;
}
有建议请提出,谢谢Thanks♪(・ω・)ノ