这几天弄了个好玩的坑人代码,喜欢就点个赞吧~~
===上代码===
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
int main(){
system("color 06");
cout<<"请输入你的幸运数字(0到9),以此来判断对你提出的问题"<<endl;
MessageBox(NULL,"切勿关闭运行页面!!!","提示",MB_OK);
int a,b,c,d;
cin>>a;
if(a>0&&a<5)
MessageBox(NULL,"你是人吗?","选择题",MB_YESNO);
if(a==5)
MessageBox(NULL,"恭喜你,你是大聪明!","提示",MB_OK);
if(a>5&&a<=9)
MessageBox(NULL,"你是失败的man吗?","选择题",MB_YESNO);
if(a<=0||a>9)
MessageBox(NULL,"数字不符合!!出错!!","提示",MB_OK);
system("color 06");
if(a<=0||a>9) MessageBox(NULL,"挑战失败!!!","提示",MB_OK);
if(a>=0&&a<=9){
cout<<"我的好朋友,你成功治好了我的疑难杂症!"<<endl;
Sleep(1000);
cout<<"那么现在,去挑战更难的吧!"<<endl;
Sleep(1000);
b=rand();c=rand();
cout<<b<<'+'<<c<<'='<<'?'<<endl;
Sleep(1000);
cin>>d;
if(d==b+c){
MessageBox(NULL,"恭喜你答对了","提示",MB_OK);
Sleep(1000);
cout<<"请选择问题模式"<<'\n';
int ms;
cout<<"1:真心话----2:计算小达人----3:脑筋急转弯----4:疑难杂症"<<'\n';
cin>>ms;
}
if(d!=b+c){
MessageBox(NULL,"答错了接受惩罚吧!","提示",MB_OK);
MessageBox(NULL,"(一株仙人掌扎进了你的屁股)你:啊!好痛","惩罚",MB_OK);
}
}
MessageBox(NULL,"游戏结束","提示",MB_OK);
return 0;
}