世上最有趣的无敌电脑9.0
喜欢的人请多多点赞
欢迎转载
原创:Re:小余 ID:ypc070309
#include <unistd.h>
#include <bits/stdc++.h>
using namespace std;
int wo = 0;
int ni = 0;
int ta = 0;
int on = 0;
int aj = 0;
int bj = 0;
string who = "\033[032m";
string when = "\033[033m";
string how = "\033[034m";
string why = "\033[035m";
string what = "\033[036m";
string shuai = "\033[031m";
string sb = "\033[000m";
char c[9] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
void print()
{
cout << "+---+---+---+" << endl;
cout << "│ " << c[0] << " │ " << c[1] << " │ " << c[2] << " │" << endl;
cout << "+---+---+---+" << endl;
cout << "│ " << c[3] << " │ " << c[4] << " │ " << c[5] << " │" << endl;
cout << "+---+---+---+" << endl;
cout << "│ " << c[6] << " │ " << c[7] << " │ " << c[8] << " │" << endl;
cout << "+---+---+---+" << endl;
}
void cerrr(const string line)
{
for(int i = 0;i < line.length();i++)
{
cout << line[i];
usleep(25000);
}
}
int main()
{
cout << "\033[034m";
cout << " +---+---+---+---+---+---+---+"<< endl;
cout << " | 欢迎使用新版max10计算机 |"<< endl;
cout << " | 知晓. 版权所有 |"<< endl;
cout << " +---+---+---+---+---+---+---+"<< endl;
cout << endl;
cout << "+---+---+---+---+---+---+---+---+---+"<< endl;
cout << "| 严禁抄袭,违者必究 |"<< endl;
cout << "| 祝大家玩得开心 求赞【>_<】 |"<< endl;
cout << "+---+---+---+---+---+---+---+---+---+"<< endl;
sleep(3);
system("clear");
int q;
cout << "\033[0m";
cout << "\033[30m";
cout << "\033[047m";
for(int l=1;l<=10;l++)
{
cout << "正在尝试自动登录中";
cerrr( "......");
system("clear");
}
cout << "算了!";
sleep(1);
system("clear");
cerrr( "点亮右上角的❤ 以开启程序");
sleep(4);
system("clear");
cerrr( "已点亮请输入1,还未点亮请输入2" );
cin>>q;
if(q==1)
{
system("clear");
cerrr("~每日一句- 长江后浪推前浪,世上今人胜古人~");
sleep( 1);
cout << endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cerrr("抵制不良游戏,拒绝盗版游戏。\n注意自我保护,谨防受骗上当。\n适度游戏益脑,沉迷游戏伤身。\n合理安排时间,享受健康生活 \n");
sleep(1);
system("clear");
while(1)
{
cout << "请问您要做什么?\n1.井字棋 \n2.走迷宫 \n3.双人抢红包 \n4.电影评分 \n5.打地鼠 \n6.扫雷 \n7.计算器\n8.石头剪刀布 \n9.猜谜语\n10.退出";
int n;
cin >> n;
sleep(2);
system("clear");
if(n==1)
{
system("clear");
cout << "欢迎来到双人决斗井字棋小游戏app" << endl;
sleep(2);
system("clear");
cout << "请注册账号(仅限于数字):";
int a;
cin >> a;
system("clear");
cout << "请注册密码:";
int b;
cin >> b;
system("clear");
int x;
cout << "请输入账号:";
cin >> x;
cout << endl;
int y;
cout << "请输入密码:";
cin >> y;
system("clear");
system("clear");
if(x == a&&y == b)
{
int q;
cout << "请问您要玩新型井字棋游戏还是传统井字棋游戏?(新型选1,传统选2)";
cin >> q;
if(q==1)
{
cout << "这是个新的井字棋游戏" << endl;
cout << "只要某一方输入的任意##形成三角形即胜利" << endl;
cout << "如图所示:" << endl;
sleep(7);
system("clear");
cout << "+---+---+---+" << endl;
cout << "| " << "\033[32m" << "o" << "\033[0m" << " | 2 | " << "\033[32m" << "o" << "\033[0m" << " |" << endl;
cout << "+---+---+---+" << endl;
cout << "| 4 |" << "\033[32m" << " o " << "\033[0m" << "| 6 |" << endl;
cout << "+---+---+---+" << endl;
cout << "| 7 | 8 | 9 |" << endl;
cout << "+---+---+---+" << endl;
sleep(5);
system("clear");
cout << "那么,加油吧!" << endl;
sleep(3);
system("clear");
cout << "\033[0m" << "\033[32m";
print();
for (int i = 1; i <= 9; i++)
{
if (i % 2 == 1)
{
cout << "请1号玩家输入下棋位置:";
int n;
cin >> n;
c[n - 1] = 'o';
}
else
{
cout << "请2号玩家输入下棋位置:";
int n;
cin >> n;
c[n - 1] = 'x';
}
system("export TERM=xterm && clear");
print();
if(c[0]==c[4]&&c[4]==c[6]&&c[6]!=' ')
{
break;
}
if(c[2]==c[4]&&c[4]==c[8]&&c[8]!=' ')
{
break;
}
if(c[0]==c[2]&&c[2]==c[4]&&c[4]!=' ')
{
break;
}
if(c[4]==c[6]&&c[6]==c[8]&&c[8]!=' ')
{
break;
}
if(c[1]==c[5]&&c[5]==c[7]&&c[7]!=' ')
{
break;
}
if(c[1]==c[3]&&c[3]==c[7]&&c[7]!=' ')
{
break;
}
if(c[3]==c[5]&&c[5]==c[7]&&c[7]!=' ')
{
break;
}
if(c[1]==c[3]&&c[3]==c[5]&&c[5]!=' ')
{
break;
}
}
}
if(q==2)
{
system("clear");
cout << "传统井字棋就不需要规则说明了吧!" << endl;
cout << "+---+---+---+" << endl;
cout << "| 1 | 2 | 3 |" << endl;
cout << "+---+---+---+" << endl;
cout << "| 4 | 5 | 6 |" << endl;
cout << "+---+---+---+" << endl;
cout << "| 7 | 8 | 9 |" << endl;
cout << "+---+---+---+" << endl;
sleep(6);
system("clear");
for(int i=1;i<=9;i++)
{
print();
if(i%2==1)
{
cout << "请一号输入下棋位置:";
int h;
cin >> h;
c[h-1]='o';
}
else
{
cout << "请二号输入下棋位置:";
int j;
cin >> j;
c[j-1]='x';
}
if(c[0]==c[1]&&c[1]==c[2]&&c[2]!=' ')
{
break;
}
if(c[3]==c[4]&&c[4]==c[5]&&c[5]!=' ')
{
break;
}
if(c[6]==c[7]&&c[7]==c[8]&&c[8]!=' ')
{
break;
}
if(c[0]==c[3]&&c[3]==c[6]&&c[6]!=' ')
{
break;
}
if(c[1]==c[4]&&c[4]==c[7]&&c[7]!=' ')
{
break;
}
if(c[2]==c[5]&&c[5]==c[8]&&c[8]!=' ')
{
break;
}
if(c[0]==c[4]&&c[4]==c[8]&&c[8]!=' ')
{
break;
}
if(c[2]==c[4]&&c[4]==c[6]&&c[6]!=' ')
{
break;
}
}
}
cout << "游戏结束";
}
else
{
cout << "密码或账号错误,请重试";
}
}
if(n==2)
{
cout << "第一关:" << endl;
char map[6][6] =
{
{'#','#','#','#','#','#'},
{'#','$',' ','#',' ',' '},
{'#',' ','#','#',' ','#'},
{'#',' ',' ','#',' ','#'},
{'#','#',' ',' ',' ','#'},
{'#','#','#','#','#','#'}
};
for (int i = 0; i <= 5; i++)
{
for (int j = 0; j <= 5; j++)
{
cout << map[i][j];
}
cout << endl;
}
int x,y;
x = 1; y = 1;
while (1)
{
cout << " w(上) " << endl;
cout << "s(下) a(左) d(右)(一次可以走一步 也可以走多步~)" << endl;
char ch;
cin >> ch;
if (ch == 's' && map[x + 1][y] != '#')
{
map[x][y] = ' ';
x++;
map[x][y] = '$';
}
if (ch == 'w' && map[x - 1][y] != '#')
{
map[x][y] = ' ';
x--;
map[x][y] = '$';
}
if (ch == 'a' && map[x][y - 1] != '#')
{
map[x][y] = ' ';
y--;
map[x][y] ='$';
}
if (ch == 'd' && map[x][y + 1] != '#')
{
map[x][y] = ' ';
y++;
map[x][y] = '$';
}
system("export TERM=xterm && clear");
for (int i = 0; i <= 5; i ++)
{
for (int j = 0; j <= 5; j++)
{
cout << map[i][j];
}
cout << endl;
}
if (map[1][5] == '$')
{
cout << "第一关闯关成功!" << endl;
sleep (1);
system("export TERM=xterm && clear");
cout << "第一关闯关成功" << endl;
break;
}
}
sleep(1);
cout << "第二关:" << endl;
char map2[6][6] =
{
{'#','#','#','#','#','#'},
{'#','$',' ','#',' ',' '},
{'#',' ','#','#',' ','#'},
{'#',' ',' ','#',' ','#'},
{'#','#',' ',' ',' ','#'},
{'#','#','#','#','#','#'}
};
for (int i2 = 0; i2 <= 5; i2++)
{
for (int j2 = 0; j2 <= 5; j2++)
{
cout << map2[i2][j2];
}
cout << endl;
}
int x2,y2;
x2 = 1; y2 = 1;
while (1)
{
cout << " w(上) " << endl;
cout << "s(下) a(左) d(右)(一次可以走一步 也可以走多步~)" << endl;
char ch;
cin >> ch;
if (ch == 's' && map2[x2 + 1][y2] != '#')
{
map2[x2][y2] = ' ';
x2++;
map2[x2][y2] = '$';
}
if (ch == 'w' && map2[x2 - 1][y2] != '#')
{
map2[x2][y2] = ' ';
x2--;
map2[x2][y2] = '$';
}
if (ch == 'a' && map2[x2][y2 - 1] != '#')
{
map2[x2][y2] = ' ';
y2--;
map2[x2][y2] ='$';
}
if (ch == 'd' && map2[x2][y2 + 1] != '#')
{
map2[x2][y2] = ' ';
y2++;
map2[x2][y2] = '$';
}
system("export TERM=xterm && clear");
for (int i2 = 0; i2 <= 5; i2 ++)
{
for (int j2 = 0; j2 <= 5; j2++)
{
cout << map2[i2][j2];
}
cout << endl;
}
if (map2[1][5] == '$')
{
cout << "第二关闯关成功!" << endl;
sleep (1);
system("export TERM=xterm && clear");
cout << "第二关闯关成功" << endl;
break;
}
}
cout << "第三关:" << endl;
char map3[6][6] =
{
{'#','#','#','#','!','#'},
{'#','$','!','#',' ','#'},
{'#',' ','#',' ',' ',' '},
{'#',' ',' ',' ','!','#'},
{'#','#','#','!','!','#'},
{'#','#','!','!','#','#'}
};
for (int i3 = 0; i3 <= 5; i3++)
{
for (int j3 = 0; j3 <= 5; j3++)
{
cout << map3[i3][j3];
}
cout << endl;
}
int x3,y3;
x3 = 1; y3 = 1;
while (1)
{
cout << " w(上) " << endl;
cout << "s(下) a(左) d(右)(一次可以走一步 也可以走多步~)" << endl;
char ch;
cin >> ch;
if (ch == 's' && map3[x3 + 1][y3] != '#')
{
map3[x3][y3] = ' ';
x3++;
map3[x3][y3] = '$';
}
if (ch == 'w' && map3[x3 - 1][y3] != '#')
{
map3[x3][y3] = ' ';
x3--;
map3[x3][y3] = '$';
}
if (ch == 'a' && map3[x3][y3 - 1] != '#')
{
map3[x3][y3] = ' ';
y3--;
map3[x3][y3] ='$';
}
if (ch == 'd' && map3[x3][y3 + 1] != '#')
{
map3[x3][y3] = ' ';
y3++;
map3[x3][y3] = '$';
}
system("export TERM=xterm && clear");
for (int i3 = 0; i3 <= 5; i3 ++)
{
for (int j3 = 0; j3 <= 5; j3++)
{
cout << map3[i3][j3];
}
cout << endl;
}
if (map3[2][5] == '$')
{
cout << "第三关闯关成功!" << endl;
sleep (1);
system("export TERM=xterm && clear");
cout << "第三关闯关成功" << endl;
break;
}
}
}
if(n==3)
{
srand(time(0));
int one = rand() % 100;
cout << "\033[31m";
cout << "welcome everybody come to 疯狂抢红包软件,现在我要发出一个100元的红包!只有两位幸运朋友可以抢到,想要吗?请持目以待!";
sleep(3);
system("export TERM=xterm&&clear");
int a , b;
cout << "请问A是否准备好抢红包了?(准备好了选1,否则选2):" << endl;
cin >> a ;
cout << "那么B呢?" << endl;
cin >> b;
if(a == 1&&b == 1)
{
cout << "A的手气红包金额为:" << one << "元" <<endl;
sleep(2);
int two = 100 - one;
cout << "B的手气红包金额为:" << two << "元" << endl;
sleep(1);
cout << "手气不错哟($-$)" << endl;
}
else
{
cout << "很遗憾,因为有人没准备好,所以红包发送不了,下次再抢吧!";
}
}
if(n==4)
{
cout << "欢迎来到豆瓣评分网"<< endl;
sleep(3);
cout << "请您为《A》《B》《C》《D》《E》《F》《G》《H》《I》《J》这十部电影评分(满分为5,最低分为1)我们会为这十部电影做出分级):" << endl;
int star;
int cnt[3] = {0, 0, 0};
for (int i = 0; i < 10; i++)
{
cin >> star;
if(star == 5)
{
cnt[0]++;
}
if(star >= 3&&star <= 4)
{
cnt[1]++;
}
if(star >= 1&&star <= 2)
{
cnt[2]++;
}
}
char name[3] = {'A', 'B', 'C'};
for (int i = 0; i <= 2; i++)
{
cout << name[i] << "级电影有:" << cnt[i] << "部" << endl;
}
}
if(n==5)
{
int zhishu = 6;
int dishu[3][5]=
{
{0,0,1,0,1},
{1,0,0,1,0},
{1,1,0,0,0}
};
int number = 0;
int success = 0;
while (zhishu > 0)
{
cout << endl;
for (int i = 0; i <= 2; i++)
{
for (int j = 0; j <= 4; j++)
{
cout <<" "<<dishu[i][j];
}
cout <<endl;
}
// 2.打地鼠:
int x , y;
cout << "地鼠在第几行:";
cin >> x;
cout << endl;
cout << "地鼠在第几列:";
cin >> y;
cout << "打地鼠中..." << endl;
sleep(2);
number++;
if (dishu[x - 1][y - 1] == 1)
{
dishu[x - 1][y - 1] = 0;
cout << "恭喜你成功打掉一只地鼠!!" << endl;
zhishu--;
success++;
cout << endl;
cout << endl;
sleep(1);
system("export TERM=xterm && clear");
}
else
{
cout << "很遗憾,那里没有地鼠!" << endl;
sleep(2);
cout << endl;
cout << endl;
system("export TERM=xterm && clear");
}
}
system("export TERM=xterm && clear");
cout << "\033[31m";
cout << "恭喜您!完成游戏!" << endl;
cout << endl;
cout << "\033[31m";
cout << "分数统计:" << endl;
cout << "游戏运行结束!" << endl;
cout << "自动退出!bye~" << endl;
}
if(n==6)
{
cout << "欢迎来到扫雷游戏";
sleep(2);
system("clear");
cout << "请注意:该游戏先输出行再输出列";
sleep(3);
system("clear");
int mine[4][4] =
{
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
for (int i = 0; i <= 3; i++)
{
for (int j = 0; j <= 3; j++)
{
cout << mine[i][j] << " ";
}
cout << endl;
}
for (int i = 0;i <= 3;i++)
{
for (int j = 0;j <= 3;j++)
{
mine[i][j]=rand() % 2;
}
}
for (int i = 1; i <= 16; i++)
{
int h, l;
cin >> h >> l;
if (h - 1 == 1 && l - 1 == 1 )
{
for (int i = 0; i <= 3; i++)
{
for (int j = 0; j <= 3; j++)
{
cout << mine[i][j] << " ";
}
cout << endl;
}
cout <<"轰💣)"<<endl;
break;
}
else
{
mine[h - 1][l - 1] = 8;
for (int i = 0; i <= 3; i++)
{
for (int j = 0; j <= 3; j++)
{
if(mine[i][j] == 1 )
{
cout << 0 << " ";
}
else
{
cout << mine[i][j] << " ";
}
}
cout << endl;
}
cout << "呼,没雷!" << endl;
}
}
}
if(n==7)
{
int a;
char ch;
int b;
cout << "请输入a的值:" << endl;
cin >> a;
sleep (1);
cout << "请输入运算符号(+-*/):" << endl;
cin >> ch;
sleep (1);
cout << "请输入b的值:" << endl;
cin >> b;
cout << "计算中......" << endl;
sleep (3);
cout << "答案是:" << endl;
sleep (1);
if (ch == '+')
{
cout << a + b << endl;
}
if (ch == '-')
{
cout << a - b << endl;
}
if (ch == '*')
{
cout << a * b << endl;
}
if (ch == '/')
{
cout << a / b << endl;
}
}
if(n==8)
{
cout<<when<<"本游戏分为两种模式,1是人机对战,2是双人对战,请选择你的模式(1或2):"<<sb;
int a;
cin>>a;
if (a == 1)
{
srand(time(0));
int c = 1+rand()%3;
int d = 1+rand()%3;
int e = 1+rand()%3;
int f = 1+rand()%3;
int g = 1+rand()%3;
usleep(500000);
system("clear");
cout<<what<<"欢迎来到人机对战,请选择模式(1为1局定胜负 2为3局定胜负 3为5局定胜负(谁赢的次数多谁就获胜)):"<<sb<<endl;
int b;
cin>>b;
if (b==1)
{
cout<<"好的"<<endl;
cout<<how<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int me;
cin>>me;
if(me==1&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<when<<"本次游戏平局"<<endl;
}
if(me==2&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<shuai<<"本次游戏平局"<<endl;
}
if(me==3&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<how<<"本次游戏平局"<<endl;
}
if(me==1&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<what<<"你赢得了游戏"<<endl;
}
if(me==2&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<when<<"你赢得了游戏"<<endl;
}
if(me==3&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<who<<"你赢得了游戏"<<endl;
}
if(me==3&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<why<<"电脑赢得了游戏"<<endl;
}
if(me==2&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<what<<"电脑赢得了游戏"<<endl;
}
if(me==1&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头" <<"vs"<<"布"<<endl;
cout<<shuai<<"电脑赢得了游戏"<<endl;
}
if(me!=1&&me!=2&&me!=3)
{
cout<<"拜拜了您"<<endl;
}
}
if(b==2)
{
cout<<"好的"<<endl;
cout<<shuai<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int m;
cin>>m;
if(m==1&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第一局,平局"<<endl;
}
if(m==2&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,平局"<<endl;
}
if(m==3&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第一局,平局"<<endl;
}
if(m==1&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,你赢了"<<endl;
wo++;
}
if(m==2&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第一局,你赢了"<<endl;
wo++;
}
if(m==3&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第一局,你赢了"<<endl;
wo++;
}
if(m==3&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,电脑赢了"<<endl;
ni++;
}
if(m==2&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第一局,电脑赢了"<<endl;
ni++;
}
if(m==1&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第一局,电脑赢了"<<endl;
ni++;
}
cout<<why<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int ck;
cin>>ck;
if(ck==1&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第二局,平局"<<endl;
}
if(ck==2&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,平局"<<endl;
}
if(ck==3&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第二局,平局"<<endl;
}
if(ck==1&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,你赢了"<<endl;
wo++;
}
if(ck==2&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第二局,你赢了"<<endl;
wo++;
}
if(ck==3&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第二局,你赢了"<<endl;
wo++;
}
if(ck==3&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,电脑赢了"<<endl;
ni++;
}
if(ck==2&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第二局,电脑赢了"<<endl;
ni++;
}
if(ck==1&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第二局,电脑赢了"<<endl;
ni++;
}
cout<<who<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int k;
cin>>k;
if(k==1&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第三局,平局"<<endl;
}
if(k==2&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,平局"<<endl;
}
if(k==3&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第三局,平局"<<endl;
}
if(k==1&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,你赢了"<<endl;
wo++;
}
if(k==2&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第三局,你赢了"<<endl;
wo++;
}
if(k==3&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第三局,你赢了"<<endl;
wo++;
}
if(k==3&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,电脑赢了"<<endl;
ni++;
}
if(k==2&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第三局,电脑赢了"<<endl;
ni++;
}
if(k==1&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第三局,电脑赢了"<<endl;
ni++;
}
if(wo>ni)
{
cout<<shuai<<"本次游戏你胜"<<endl;
}
if(wo<ni)
{
cout<<shuai<<"本次游戏电脑胜"<<endl;
}
if(wo==ni)
{
cout<<shuai<<"本次游戏平局"<<endl;
}
}
if(b==3)
{
cout<<"好的"<<endl;
cout<<when<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int zhen;
cin>>zhen;
if(zhen==1&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第一局,平局"<<endl;
}
if(zhen==2&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,平局"<<endl;
}
if(zhen==3&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第一局,平局"<<endl;
}
if(zhen==1&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,你赢了"<<endl;
ta++;
}
if(zhen==2&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第一局,你赢了"<<endl;
ta++;
}
if(zhen==3&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第一局,你赢了"<<endl;
ta++;
}
if(zhen==3&&c==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第一局,电脑赢了"<<endl;
on++;
}
if(zhen==2&&c==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第一局,电脑赢了"<<endl;
on++;
}
if(zhen==1&&c==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第一局,电脑赢了"<<endl;
on++;
}
cout<<why<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int md;
cin>>md;
if(md==1&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第二局,平局"<<endl;
}
if(md==2&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,平局"<<endl;
}
if(md==3&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第二局,平局"<<endl;
}
if(md==1&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,你赢了"<<endl;
ta++;
}
if(md==2&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第二局,你赢了"<<endl;
ta++;
}
if(md==3&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第二局,你赢了"<<endl;
ta++;
}
if(md==3&&d==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第二局,电脑赢了"<<endl;
on++;
}
if(md==2&&d==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第二局,电脑赢了"<<endl;
on++;
}
if(md==1&&d==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第二局,电脑赢了"<<endl;
on++;
}
cout<<shuai<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int wc;
cin>>wc;
if(wc==1&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第三局,平局"<<endl;
}
if(wc==2&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,平局"<<endl;
}
if(wc==3&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第三局,平局"<<endl;
}
if(wc==1&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,你赢了"<<endl;
ta++;
}
if(wc==2&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第三局,你赢了"<<endl;
ta++;
}
if(wc==3&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第三局,你赢了"<<endl;
ta++;
}
if(wc==3&&e==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第三局,电脑赢了"<<endl;
on++;
}
if(wc==2&&e==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第三局,电脑赢了"<<endl;
on++;
}
if(wc==1&&e==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第三局,电脑赢了"<<endl;
on++;
}
cout<<what<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int dj;
cin>>dj;
if(dj==1&&f==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第四局,平局"<<endl;
}
if(dj==2&&f==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第四局,平局"<<endl;
}
if(dj==3&&f==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第四局,平局"<<endl;
}
if(dj==1&&f==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第四局,你赢了"<<endl;
ta++;
}
if(dj==2&&f==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第四局,你赢了"<<endl;
ta++;
}
if(dj==3&&f==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第四局,你赢了"<<endl;
ta++;
}
if(dj==3&&f==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第四局,电脑赢了"<<endl;
on++;
}
if(dj==2&&f==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第四局,电脑赢了"<<endl;
on++;
}
if(dj==1&&f==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第四局,电脑赢了"<<endl;
on++;
}
cout<<who<<"请输入(1=石头 2=剪刀 3=布):"<<sb;
int sl;
cin>>sl;
if(sl==1&&g==1)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<"第五局,平局"<<endl;
}
if(sl==2&&g==2)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<"第五局,平局"<<endl;
}
if(sl==3&&g==3)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<"第五局,平局"<<endl;
}
if(sl==1&&g==2)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<"第五局,你赢了"<<endl;
ta++;
}
if(sl==2&&g==3)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<"第五局,你赢了"<<endl;
ta++;
}
if(sl==3&&g==1)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<"第五局,你赢了"<<endl;
ta++;
}
if(sl==3&&g==2)
{
cout<<"你 电脑"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<"第五局,电脑赢了"<<endl;
on++;
}
if(sl==2&&g==1)
{
cout<<"你 电脑"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<"第五局,电脑赢了"<<endl;
on++;
}
if(sl==1&&g==3)
{
cout<<"你 电脑"<<endl;
cout<<"石头"<<"vs"<<"布"<<endl;
cout<<"第五局,电脑赢了"<<endl;
on++;
}
if(ta>on)
{
cout<<shuai<<"本次游戏你胜"<<endl;
}
if(ta<on)
{
cout<<shuai<<"本次游戏电脑胜"<<endl;
}
if(ta==on)
{
cout<<shuai<<"本次游戏平局"<<endl;
}
}
if(b!=1&&b!=2&&b!=3)
{
cout<<"拜拜了您"<<endl;
}
}
if (a == 2)
{
cout<<"好的。"<<endl;
cout<<"请问您要进行几局石头剪刀布?(不许超过十回合)"<<endl;
int z ;
cin>>z;
if(z<=10&&z>0)
{
cout<<"好嘞!!!"<<endl;
sleep(1);
for(int i = 1 ; i <= z;i++)
{
system("clear");
cout<<"第"<<i<<"回合"<<endl;
cout<<"请玩家1输入:(1=石头 2=剪刀 3=布)"<<shuai<<"(此时玩家2不许偷看)"<<sb<<endl;
int mc;
cin>>mc;
cout<<"好的"<<endl;
sleep(1);
system("clear");
cout<<"第"<<i<<"回合"<<endl;
cout<<"请玩家2输入:(1=石头 2=剪刀 3=布)"<<shuai<<"(此时玩家1不许偷看)"<<sb<<endl;
int mn;
cin>>mn;
cout<<"好的"<<endl;
sleep(1);
system("clear");
if(mc==1&&mn==1)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"石头"<<"vs"<<"石头"<<endl;
cout<<how<<"第"<<i<<"回合平局"<<sb<<endl;
sleep(4);
}
if(mc==2&&mn==2)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"剪刀"<<"vs"<<"剪刀"<<endl;
cout<<how<<"第"<<i<<"回合平局"<<sb<<endl;
sleep(4);
}
if(mc==3&&mn==3)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"布"<<"vs"<<"布"<<endl;
cout<<how<<"第"<<i<<"回合平局"<<sb<<endl;
sleep(4);
}
if(mc==1&&mn==2)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"石头"<<"vs"<<"剪刀"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家1胜"<<sb<<endl;
aj++;
sleep(4);
}
if(mc==2&&mn==3)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"剪刀"<<"vs"<<"布"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家1胜"<<sb<<endl;
aj++;
sleep(4);
}
if(mc==3&&mn==1)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"布"<<"vs"<<"石头"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家1胜"<<sb<<endl;
aj++;
sleep(4);
}
if(mc==3&&mn==2)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"布"<<"vs"<<"剪刀"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家2胜"<<sb<<endl;
bj++;
sleep(4);
}
if(mc==2&&mn==1)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"剪刀"<<"vs"<<"石头"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家2胜"<<sb<<endl;
bj++;
sleep(4);
}
if(mc==1&&mn==3)
{
cout<<"玩家1 玩家2"<<endl;
cout<<"石头" <<"vs"<<"布"<<endl;
cout<<shuai<<"第"<<i<<"回合玩家2胜"<<sb<<endl;
bj++;
sleep(4);
}
if(aj==bj)
{
cout<<"双方打为平手"<<endl;
}
if(aj>bj)
{
cout<<"玩家1胜利"<<endl;
}
if(aj<bj)
{
cout<<"玩家2胜利"<<endl;
}
}
}
}
if(a!=1&&a!=2)
{
cout<<"拜拜了"<<endl;
}
}
if(n==9)
{
cout << "准备好猜谜语了吗?";
sleep(1);
system("clear");
cout << "请选择难度:1 2";
int d;
cin >> d;
if(d==1)
{
while(1)
{
cout << "田中(打一字)";
cout << endl;
cout << "1 口 2 甘 3 十 4 古" ;
int q;
cin >> q;
if(q==3)
{
cout << "恭喜你,答对了!";
sleep(1);
system("clear");
}
else
{
break;
}
cout << "什么东西越洗越脏?";
cout << "1 衣服 2 水 3 大米 4 !!!";
int c;
cin >> c;
if(c==2)
{
cout << "恭喜你,答对了!";
sleep(1);
system("clear");
}
else
{
break;
}
cout << "恭喜!";
}
if(d==2)
{
while(1)
{
cout << "我)";
cout << endl;
cout << "1 帅气 2 呵呵 3 一般 4 古" ;
int q;
cin >> q;
if(q==1)
{
cout << "恭喜你,答对了!";
sleep(1);
system("clear");
}
else
{
break;
}
cout << "什么东西越洗越不脏?";
cout << "1 衣服 2 水 3 饮料 4 !!!";
int c;
cin >> c;
if(c==1)
{
cout << "恭喜你,答对了!";
sleep(1);
system("clear");
}
else
{
break;
}
cout << "恭喜!";
}
}
}
}
if(n==100)
{
cerrr("你竟然发现了此电脑的隐藏程序!");
cout << endl;
cerrr("不过,隐藏程序也没什么呢");
cout << endl;
cout << "是否回到电脑?";
int b;
cin >>b;
if(b==2)
{
break;
}
}
if(n==10)
{
cout<< "退出成功";
break;
}
sleep(1);
system("clear");
}
}
else
{
cout << "那就拜拜了!";
}
return 0;
}