youdianxiaolaj
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a[2],j,ma,me,t;
bool kill=true;
string name;
int main()
{
cout<<"请签署生死状"<<endl;
cin>>name;
system("cls");
for(int i=1;i<=3;i++)
{
cout<<'I';
_sleep(250);
system("cls");
_sleep(250);
}
srand(time(0));
me=ma=rand()%4+2;
_sleep(1100);
system("cls");
srand(time(0));
int jntm=rand()%2+1;
if(jntm==1) me--;
while(1)
{
kill=true;
do
{
srand(time(0));
a[1]=rand()%2+1;
if(ma==0)
{
cout<<"你赢了,取钱走人";
return 0;
}
if(me==0)
{
cout<<"去亖吧!";
system("shutdown -s -t 0");
}
system("cls");
cout<<"庄家:"<<ma<<endl<<name<<':'<<me;
_sleep(1300);
system("cls");
cout<<"打谁?"<<endl;
cout<<"1.你 "<<"2.庄家"<<endl;
cin>>j;
if(j==1)
{
if(a[1]==1)
{
system("cls");
_sleep(1000);
cout<<"你中枪了!";
me--;
_sleep(1000);
system("cls");
if(me==1) cout<<"下一次,小心...";
_sleep(2000);
system("cls");
kill=false;
}
else
{
cout<<"没逝";
_sleep(1000);
system("cls");
srand(time(0));
a[1]=rand()%2+1;
}
}
else
{
if(a[1])
{
cout<<"他中枪了!";
ma--;
_sleep(1000);
system("cls");
}
else
{
cout<<"没逝";
_sleep(1000);
system("cls");
}
kill=false;
}
if(ma==0)
{
cout<<"你赢了,取钱走人";
return 0;
}
if(me==0)
{
cout<<"去亖吧!";
system("shutdown -s -t 0");
}
}while(kill);
bool jump=true;
do
{
srand(time(0));
int jntm=rand()%6+1;
if(jntm>3)
{
cout<<"他朝你开枪";
_sleep(800);
system("cls");
if(a[1]==1)
{
system("cls");
_sleep(2000);
cout<<"你中枪了!";
me--;
_sleep(1000);
system("cls");
}
else
{
_sleep(2000);
cout<<"没逝";
_sleep(1000);
system("cls");
}
jump=false;
}
else
{
cout<<"他射自己";
_sleep(800);
system("cls");
if(a[1]==1)
{
_sleep(1000);
cout<<"他中枪了";
_sleep(1000);
system("cls");
ma--;
jump=false;
}
else
{
_sleep(2000);
cout<<"没逝";
_sleep(1000);
system("cls");
srand(time(0));
a[1]=rand()%2+1;
}
}
if(ma<=0) break;
if(me<=0) break;
}while(jump);
if(ma==0)
{
cout<<"你赢了,取钱走人";
return 0;
}
if(me==0)
{
cout<<"去亖吧!";
system("shutdown -s -t 0");
}
}
}
标签:中文,cout,--,system,name,int,xiaoyouxi,include,cls
From: https://blog.csdn.net/BIGzhk/article/details/141071994