初级守护
#include<bits/stdc++.h>
#include<windows.h>
#include<stdlib.h>
#include<ctime>
using namespace std;
int a,b,cnt,q,m,n,l,k,p;
enum fy
{
d1 = 262, d1_ = 277, d2 = 294, d2_ = 311, d3 = 330, d4 = 349, d5 = 392, d5_= 415,
d6 = 440, d6_= 466, d7 = 494, z1 = 523, z1_ = 554, z2 = 578, z2_ = 622, z3 = 659,
z4 = 698, z4_ = 740, z5 = 784, z5_ = 831, z6 = 880, z6_ = 932, z7 = 988, g1 = 1046,
g1_ = 1109, g2 = 1175, g2_ = 1245, g3 = 1318, g4 = 1397, g4_ = 1480,
g5 = 1568, g5_ = 1661, g6 = 1760, g6_ = 1865, g7 = 1976, yaya = 0
};
//定义音符
struct yf
{
enum fy s;
int t;
};
//定义
void HideCursor()
{
CONSOLE_CURSOR_INFO cursor;
cursor.bVisible = FALSE;
cursor.dwSize = sizeof(cursor);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(handle, &cursor);
}
//隐藏光标
int main()
{
int minn=23,maxn=233;
srand((int)time(NULL));
int ans=minn+rand()%(maxn-minn+1);
//彩蛋,23~233随机一个数
{
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
while(1){
if(q>=100){
cout<<"加载完成!";
Sleep(1100);
break;
}
q=q+2;
cout<<q;
cout<<"%";
Sleep(0.03);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
}
system("cls");
}
//开头
while(1){
{
system("cls");
cout<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
cout<<"____________________________________________________";
Sleep(50);
cout<<endl;
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//1
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//2
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//3
cout<<" ";
cout<<"|";
cout<<" 1.开始游戏 ";
cout<<"|";
Sleep(50);
cout<<endl;
//4
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//5
cout<<" ";
cout<<"|";
cout<<" 2.说明 ";
cout<<"|";
Sleep(50);
cout<<endl;
//6
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//7
cout<<" ";
cout<<"|";
cout<<" 3.退出游戏 ";
cout<<"|";
Sleep(50);
cout<<endl;
//8
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//9
cout<<" ";
cout<<"|";
cout<<" 4.杂项 ";
cout<<"|";
Sleep(50);
cout<<endl;
//10
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//11
cout<<" ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<endl;
//12
cout<<" ";
cout<<"|";
cout<<"版本:0.25 ";
cout<<"|";
Sleep(50);
cout<<endl;
//13
cout<<" ";
cout<<"----------------------------------------------------";
system("color 00");
cout<<endl;
cout<<" ";
cout<<"请输入:";
cin>>a;
}
//开始界面
{
if(a==1){
system("cls");
}
}
//if(a==1)
{
if(a==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"游";
Sleep(250);
cout<<"戏";
Sleep(250);
cout<<"作";
Sleep(250);
cout<<"者";
Sleep(250);
cout<<":";
Sleep(250);
cout<<"0";
Sleep(250);
cout<<"0";
Sleep(250);
cout<<"2";
Sleep(250);
cout<<"4";
Sleep(300);
system("cls");
}
}
//if(a==2)
{
if(a==3){
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
cout<<"真";
Sleep(100);
cout<<"的";
Sleep(100);
cout<<"要";
Sleep(100);
cout<<"退";
Sleep(100);
cout<<"出";
Sleep(100);
cout<<"吗";
Sleep(100);
cout<<"?";
Sleep(100);
cout<<endl<<endl;
cout<<" ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"继";
Sleep(100);
cout<<"续";
Sleep(100);
cout<<" ";
cout<<"2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"退";
Sleep(100);
cout<<"出";
Sleep(100);
cout<<endl<<endl;
cout<<" ";
cout<<" ";
cout<<"请输入:";
cin>>b;
if(b==1){
system("cls");
continue;
}
if(b==2){
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
Sleep(60);
cout<<"感";
Sleep(200);
cout<<"谢";
Sleep(200);
cout<<"使";
Sleep(200);
cout<<"用";
cout<<endl;
Sleep(200);
cout<<" ";
cout<<">_<";
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
break;
}
if(b!=1&&b!=2){
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
cout<<"我";
Sleep(600);
cout<<"帮";
Sleep(600);
cout<<"你";
Sleep(600);
cout<<"退";
Sleep(600);
cout<<"出";
Sleep(1000);
break;
}
}
}
//if(a==3)
{
if(a==4){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"改";
Sleep(100);
cout<<"变";
Sleep(100);
cout<<"颜";
Sleep(100);
cout<<"色";
Sleep(100);
cout<<" ";
cout<<"2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"作";
Sleep(100);
cout<<"者";
Sleep(100);
cout<<"的";
Sleep(100);
cout<<"话";
Sleep(100);
cout<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>m;
if(m==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"背";
Sleep(100);
cout<<"景";
Sleep(100);
cout<<" ";
cout<<"2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"字";
Sleep(100);
cout<<"体";
Sleep(100);
cout<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>n;
if(n==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
Sleep(80);
cout<<endl;
cout<<" ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黑";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"2";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"3";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"4";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"湖";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"5";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"6";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"7";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"8";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n";
cout<<" ";
cout<<"9";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"灰";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"10";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"11";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(100);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"12";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"浅";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"13";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"14";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"15";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"16";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"亮";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<endl<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>l;
if(l==0){
system("cls");
continue;
}
if(l==1){
system("color 00");
}
if(l==2){
system("color 10");
}
if(l==3){
system("color 20");
}
if(l==4){
system("color 30");
}
if(l==5){
system("color 40");
}
if(l==6){
system("color 50");
}
if(l==7){
system("color 60");
}
if(l==8){
system("color 70");
}
if(l==9){
system("color 80");
}
if(l==10){
system("color 90");
}
if(l==11){
system("color A0");
}
if(l==12){
system("color B0");
}
if(l==13){
system("color C0");
}
if(l==14){
system("color D0");
}
if(l==15){
system("color E0");
}
if(l==16){
system("color F0");
}
}
if(n==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
Sleep(80);
cout<<endl;
cout<<" ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黑";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"2";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"3";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"4";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"湖";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"5";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"6";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"7";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"8";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n";
cout<<" ";
cout<<"9";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"灰";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"10";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"11";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(100);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"12";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"浅";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"13";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"14";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"15";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"16";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"亮";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<endl<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>l;
if(l==0){
system("cls");
continue;
}
if(l==1){
system("color 0");
}
if(l==2){
system("color 1");
}
if(l==3){
system("color 2");
}
if(l==4){
system("color 3");
}
if(l==5){
system("color 4");
}
if(l==6){
system("color 5");
}
if(l==7){
system("color 6");
}
if(l==8){
system("color 7");
}
if(l==9){
system("color 8");
}
if(l==10){
system("color 9");
}
if(l==11){
system("color A");
}
if(l==12){
system("color B");
}
if(l==13){
system("color C");
}
if(l==14){
system("color D");
}
if(l==15){
system("color E");
}
if(l==16){
system("color F");
}
}
if(n!=1&&n!=2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"拜";
Sleep(500);
cout<<"拜";
Sleep(500);
cout<<"手";
Sleep(500);
cout<<"残";
Sleep(500);
cout<<"党";
Sleep(700);
system("cls");
continue;
}
}
if(m==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"施";
Sleep(100);
cout<<"工";
Sleep(100);
cout<<"中";
Sleep(100);
cout<<endl<<endl;
cout<<"\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
cout<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>k;
if(k==0){
system("cls");
continue;
}
if(k!=0){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"咳";
Sleep(500);
cout<<"咳";
Sleep(600);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"施";
Sleep(100);
cout<<"工";
Sleep(100);
cout<<"中";
Sleep(100);
cout<<endl<<endl;
cout<<"\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
cout<<" ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"作";
Sleep(80);
cout<<"者";
Sleep(80);
cout<<"的";
Sleep(80);
cout<<"话";
Sleep(80);
cout<<endl<<endl;
cout<<" ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>p;
if(p==0){
system("cls");
continue;
}
if(p==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"嘿";
Sleep(200);
cout<<"嘿";
Sleep(350);
cout<<"被";
Sleep(200);
cout<<"发";
Sleep(200);
cout<<"现";
Sleep(200);
cout<<"了";
Sleep(200);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"这";
Sleep(200);
cout<<"是";
Sleep(200);
cout<<"我";
Sleep(200);
cout<<"做";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"第";
Sleep(200);
cout<<"一";
Sleep(200);
cout<<"款";
Sleep(200);
cout<<"游";
Sleep(200);
cout<<"戏";
Sleep(800);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"如";
Sleep(200);
cout<<"果";
Sleep(200);
cout<<"做";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"不";
Sleep(200);
cout<<"好";
Sleep(200);
cout<<"勿";
Sleep(200);
cout<<"喷";
Sleep(900);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"发";
Sleep(200);
cout<<"现";
Sleep(200);
cout<<"b";
Sleep(200);
cout<<"u";
Sleep(200);
cout<<"g";
Sleep(200);
cout<<"请";
Sleep(200);
cout<<"告";
Sleep(200);
cout<<"诉";
Sleep(200);
cout<<"我";
Sleep(400);
cout<<endl;
cout<<"\t\t\t ";
cout<<"我";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"Q";
Sleep(200);
cout<<"Q";
Sleep(200);
cout<<":";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"4";
Sleep(200);
cout<<"7";
Sleep(200);
cout<<"5";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"0";
Sleep(200);
cout<<"2";
Sleep(200);
cout<<"4";
Sleep(200);
cout<<"3";
Sleep(2000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"本";
Sleep(200);
cout<<"来";
Sleep(622);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"我";
Sleep(200);
cout<<"想";
Sleep(200);
cout<<"送";
Sleep(200);
cout<<"给";
Sleep(200);
cout<<"一";
Sleep(200);
cout<<"个";
Sleep(200);
cout<<"人";
Sleep(700);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"但";
Sleep(200);
cout<<"我";
Sleep(200);
cout<<"想";
Sleep(200);
cout<<"想";
Sleep(650);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
}
if(p!=0&&p!=1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"拜";
Sleep(500);
cout<<"拜";
Sleep(500);
cout<<"手";
Sleep(500);
cout<<"残";
Sleep(500);
cout<<"党";
Sleep(700);
system("cls");
continue;
}
}
}
}
system("cls");
}
//if(a==4)
{
if(a==ans){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"恭";
Sleep(150);
cout<<"喜";
Sleep(150);
cout<<"发";
Sleep(150);
cout<<"现";
Sleep(150);
cout<<"彩";
Sleep(150);
cout<<"蛋";
Sleep(150);
cout<<"给";
Sleep(150);
cout<<"你";
Sleep(150);
cout<<"放";
Sleep(150);
cout<<"首";
Sleep(150);
cout<<"歌";
Sleep(150);
struct yf a[1000]={
{z6,50},{z7,50},{g1,150},{z7,50},{g1,100}, //5
{g3,100},{z7,300},{z3,100},{z6,150},{z5,50}, //10
{z6,100},{g1,100},{z5,300},{z2,50}, //14
{z3,50},{z4,150},{z3,50},{z4,50},{g1,150}, //19
{z3,150},{z2,50},{z3,50},{g1,150},{z7,150}, //24
{z4_,50},{z4_,100},{z7,100},{z7,200},{z6,50}, //29
{z7,50},{g1,150},{z7,50},{g1,100},{g3,100}, //34
{z7,200},{z3,100},{z6,150}, //37
{z5,50},{z6,100},{g1,100},{z5,300},{z3,100},{z4,100},{g1,50}, //44
{z7,150},{g1,100},{g2,100}, //47
{g3,50},{g1,150},{g1,50},{z7,50},{z6,100},{z7,100},{z5_,100}, //54
{z6,300},{g1,50},{g2,50}, //57
{g3,150},{g2,50},{g3,100},{g5,100},{g2,300},{z5,100}, //63
{g1,150},{z7,50},{g1,100},{g3,100},{g3,300},{z6,50},{z7,50},{g1,150}, //71
{z7,50},{g1,100},{g2,100},{g1,150},{z5,50}, //76
{z5,200},{g4,100},{g3,100},{g2,100},{g1,100}, //81
{g3,400},{yaya,50},{g3,50},{g6,200},{g5,100},{g5,100},{g3,50}, //88
{g2,50},{g1,100},{yaya,50},{g1,50},{g2,100},{g1,50},{g2,100},{g5,100}, //96
{g3,200},{yaya,50},{g3,50},{g6,200},{g5,200},{g3,50},{g2,50}, //103
{g1,200},{yaya,50},{g1,50},{g2,100},{g1,50},{g2,100},{z7,100}, //110
{z6,200},{yaya,100},{z6,50},{z7,50},{z6,500}
};
struct yf*atop;
atop=a;
int n=194;
while(n--)
{
Beep(atop->s,atop->t*5);
atop++;
}
system("cls");
}
}
//if(a==ans)
{
if(a==4399){
}
}
//if(a==4399)
{
if(a!=1&&a!=2&&a!=3&&a!=4&&a!=ans){
system("cls");
cnt++;
if(cnt==4){
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
cout<<"叫";
Sleep(100);
cout<<"你";
Sleep(100);
cout<<"不";
Sleep(100);
cout<<"听";
Sleep(1000);
system("cls");
while(1){
cout<<"事不过三"<<" ";
}
}
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" ";
cout<<"在";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"错";
Sleep(100);
cout<<"你";
Sleep(100);
cout<<"就";
Sleep(100);
cout<<"完";
Sleep(100);
cout<<"了";
Sleep(500);
system("cls");
}
}
//if(a!=1&&a!=2&&a!=3&&a!=4&&a!=ans&&a!=4399)
}
}
怎么又能改变背景颜色,又能改变字体颜色
意见好的采纳
金棕乐在2020-08-10 18:26:42追加了内容
大佬们,勿喷
金棕乐在2020-08-14 17:51:34追加了内容
#include<bits/stdc++.h>
#include<windows.h>
#include<winioctl.h>
#include<stdlib.h>
#include<ctime>
using namespace std;
int a,b,cnt,q,m,n,l,k,p,d,w;
enum fy
{
d1 = 262, d1_ = 277, d2 = 294, d2_ = 311, d3 = 330, d4 = 349, d5 = 392, d5_= 415,
d6 = 440, d6_= 466, d7 = 494, z1 = 523, z1_ = 554, z2 = 578, z2_ = 622, z3 = 659,
z4 = 698, z4_ = 740, z5 = 784, z5_ = 831, z6 = 880, z6_ = 932, z7 = 988, g1 = 1046,
g1_ = 1109, g2 = 1175, g2_ = 1245, g3 = 1318, g4 = 1397, g4_ = 1480,
g5 = 1568, g5_ = 1661, g6 = 1760, g6_ = 1865, g7 = 1976, yaya = 0
};
//定义音符
struct yf
{
enum fy s;
int t;
};
//定义
void HideCursor()
{
CONSOLE_CURSOR_INFO cursor;
cursor.bVisible = FALSE;
cursor.dwSize = sizeof(cursor);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(handle, &cursor);
}
//隐藏光标
int main()
{
int minn=23,maxn=233;
srand((int)time(NULL));
int ans=minn+rand()%(maxn-minn+1);
//彩蛋,23~233随机一个数
{
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
while(1){
if(q>=100){
cout<<"加载完成!";
Sleep(1100);
break;
}
q=q+2;
cout<<q;
cout<<"%";
Sleep(0.03);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
}
system("cls");
}
//开头
while(1){
{
system("cls");
cout<<"\n\n\n\n\n ";
cout<<"____________________________________________________";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" 1.开始游戏 ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" 2.说明 ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" 3.退出游戏 ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" 4.杂项 ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<" ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"|";
cout<<"版本:0.62 ";
cout<<"|";
Sleep(50);
cout<<"\n ";
cout<<"----------------------------------------------------";
cout<<"\n ";
cout<<"请输入:";
cin>>a;
}
//开始界面
{
if(a==1){
system("cls");
}
}
//if(a==1)
{
if(a==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string ya="游戏作者:0024";
for(int i=0;i<ya.size();i++)
{
cout<<ya[i];
Sleep(200);
}
Sleep(200);
system("cls");
}
}
//if(a==2)
{
if(a==3){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string ya="真的要退出吗?";
for(int i=0;i<ya.size();i++)
{
cout<<ya[i];
Sleep(130);
}
cout<<"\n\n\t\t\t ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"继";
Sleep(100);
cout<<"续";
Sleep(100);
cout<<" ";
cout<<"2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"退";
Sleep(100);
cout<<"出";
Sleep(100);
cout<<"\n\n\t\t\t ";
cout<<"请输入:";
cin>>b;
if(b==1){
system("cls");
continue;
}
if(b==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
Sleep(60);
cout<<"感";
Sleep(200);
cout<<"谢";
Sleep(200);
cout<<"使";
Sleep(200);
cout<<"用";
Sleep(200);
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<">_<";
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
break;
}
if(b!=1&&b!=2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"我";
Sleep(600);
cout<<"帮";
Sleep(600);
cout<<"你";
Sleep(600);
cout<<"退";
Sleep(600);
cout<<"出";
Sleep(1000);
break;
}
}
}
//if(a==3)
{
if(a==4){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"改";
Sleep(100);
cout<<"变";
Sleep(100);
cout<<"颜";
Sleep(100);
cout<<"色";
Sleep(100);
cout<<" ";
cout<<"2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"作";
Sleep(100);
cout<<"者";
Sleep(100);
cout<<"的";
Sleep(100);
cout<<"话";
Sleep(100);
cout<<"\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>m;
if(m==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"1";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"背";
Sleep(100);
cout<<"景";
Sleep(100);
cout<<" 2";
Sleep(100);
cout<<".";
Sleep(100);
cout<<"字";
Sleep(100);
cout<<"体";
Sleep(100);
cout<<"\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>n;
if(n==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\t\t\t ";
string w="0.返回";
for(int i=0;i<w.size();i++){
cout<<w[i];
Sleep(80);
}
cout<<"\n ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黑";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"2";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"3";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"4";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"湖";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"5";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"6";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"7";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"8";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n ";
cout<<"9";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"灰";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"10";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"11";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(100);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"12";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"浅";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"13";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"14";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"15";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"16";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"亮";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>l;
if(l==0){
system("cls");
continue;
}
if(l==1){
system("color 00");
}
if(l==2){
system("color 10");
}
if(l==3){
system("color 20");
}
if(l==4){
system("color 30");
}
if(l==5){
system("color 40");
}
if(l==6){
system("color 50");
}
if(l==7){
system("color 60");
}
if(l==8){
system("color 70");
}
if(l==9){
system("color 80");
}
if(l==10){
system("color 90");
}
if(l==11){
system("color A0");
}
if(l==12){
system("color B0");
}
if(l==13){
system("color C0");
}
if(l==14){
system("color D0");
}
if(l==15){
system("color E0");
}
if(l==16){
system("color F0");
}
}
if(n==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\t\t\t ";
string q="0.返回";
for(int i=0;i<q.size();i++){
cout<<q[i];
Sleep(80);
}
cout<<"\n ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黑";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"2";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"3";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"4";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"湖";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"5";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"6";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"7";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"8";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n ";
cout<<"9";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"灰";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"10";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"蓝";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"11";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(100);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"12";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"浅";
Sleep(80);
cout<<"绿";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"13";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"红";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"14";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"紫";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"15";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"淡";
Sleep(80);
cout<<"黄";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<" ";
cout<<"16";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"亮";
Sleep(80);
cout<<"白";
Sleep(80);
cout<<"色";
Sleep(80);
cout<<"\n\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>l;
if(l==0){
system("cls");
continue;
}
if(l==1){
system("color 0");
}
if(l==2){
system("color 1");
}
if(l==3){
system("color 2");
}
if(l==4){
system("color 3");
}
if(l==5){
system("color 4");
}
if(l==6){
system("color 5");
}
if(l==7){
system("color 6");
}
if(l==8){
system("color 7");
}
if(l==9){
system("color 8");
}
if(l==10){
system("color 9");
}
if(l==11){
system("color A");
}
if(l==12){
system("color B");
}
if(l==13){
system("color C");
}
if(l==14){
system("color D");
}
if(l==15){
system("color E");
}
if(l==16){
system("color F");
}
}
if(n!=1&&n!=2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"拜";
Sleep(500);
cout<<"拜";
Sleep(500);
cout<<"手";
Sleep(500);
cout<<"残";
Sleep(500);
cout<<"党";
Sleep(700);
system("cls");
continue;
}
}
if(m==2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"施";
Sleep(100);
cout<<"工";
Sleep(100);
cout<<"中";
Sleep(100);
cout<<"\n\n\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
cout<<"\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>k;
if(k==0){
system("cls");
continue;
}
if(k!=0){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"咳";
Sleep(500);
cout<<"咳";
Sleep(600);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"施";
Sleep(100);
cout<<"工";
Sleep(100);
cout<<"中";
Sleep(100);
cout<<"\n\n\t\t\t ";
cout<<"0";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"返";
Sleep(80);
cout<<"回";
cout<<" ";
cout<<"1";
Sleep(80);
cout<<".";
Sleep(80);
cout<<"作";
Sleep(80);
cout<<"者";
Sleep(80);
cout<<"的";
Sleep(80);
cout<<"话";
Sleep(80);
cout<<"\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>p;
if(p==0){
system("cls");
continue;
}
if(p==1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"嘿";
Sleep(200);
cout<<"嘿";
Sleep(350);
cout<<"被";
Sleep(200);
cout<<"发";
Sleep(200);
cout<<"现";
Sleep(200);
cout<<"了";
Sleep(200);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"这";
Sleep(200);
cout<<"是";
Sleep(200);
cout<<"我";
Sleep(200);
cout<<"做";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"第";
Sleep(200);
cout<<"一";
Sleep(200);
cout<<"款";
Sleep(200);
cout<<"游";
Sleep(200);
cout<<"戏";
Sleep(800);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"如";
Sleep(200);
cout<<"果";
Sleep(200);
cout<<"做";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"不";
Sleep(200);
cout<<"好";
Sleep(200);
cout<<"勿";
Sleep(200);
cout<<"喷";
Sleep(900);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"发";
Sleep(200);
cout<<"现";
Sleep(200);
cout<<"b";
Sleep(200);
cout<<"u";
Sleep(200);
cout<<"g";
Sleep(200);
cout<<"请";
Sleep(200);
cout<<"告";
Sleep(200);
cout<<"诉";
Sleep(200);
cout<<"我";
Sleep(400);
cout<<"\n\t\t\t ";
cout<<"我";
Sleep(200);
cout<<"的";
Sleep(200);
cout<<"Q";
Sleep(200);
cout<<"Q";
Sleep(200);
cout<<":";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"4";
Sleep(200);
cout<<"7";
Sleep(200);
cout<<"5";
Sleep(200);
cout<<"3";
Sleep(200);
cout<<"0";
Sleep(200);
cout<<"2";
Sleep(200);
cout<<"4";
Sleep(200);
cout<<"3";
Sleep(2000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"本";
Sleep(200);
}
if(p!=0&&p!=1){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"拜";
Sleep(500);
cout<<"拜";
Sleep(500);
cout<<"手";
Sleep(500);
cout<<"残";
Sleep(500);
cout<<"党";
Sleep(700);
system("cls");
continue;
}
}
if(m!=1&&m!=2){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"拜";
Sleep(500);
cout<<"拜";
Sleep(500);
cout<<"手";
Sleep(500);
cout<<"残";
Sleep(500);
cout<<"党";
Sleep(700);
system("cls");
continue;
}
}
}
system("cls");
}
//if(a==4)
{
if(a==ans){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string e="恭喜发现彩蛋给你放首歌";
for(int i=0;i<e.size();i++){
cout<<e[i];
Sleep(110);
}
Sleep(33);
struct yf a[1000]={
{z6,50},{z7,50},{g1,150},{z7,50},{g1,100},
{g3,100},{z7,300},{z3,100},{z6,150},{z5,50},
{z6,100},{g1,100},{z5,300},{z2,50},
{z3,50},{z4,150},{z3,50},{z4,50},{g1,150},
{z3,150},{z2,50},{z3,50},{g1,150},{z7,150},
{z4_,50},{z4_,100},{z7,100},{z7,200},{z6,50},
{z7,50},{g1,150},{z7,50},{g1,100},{g3,100},
{z7,200},{z3,100},{z6,150},
{z5,50},{z6,100},{g1,100},{z5,300},{z3,100},{z4,100},{g1,50},
{z7,150},{g1,100},{g2,100},
{g3,50},{g1,150},{g1,50},{z7,50},{z6,100},{z7,100},{z5_,100},
{z6,300},{g1,50},{g2,50},
{g3,150},{g2,50},{g3,100},{g5,100},{g2,300},{z5,100},
{g1,150},{z7,50},{g1,100},{g3,100},{g3,300},{z6,50},{z7,50},{g1,150},
{z7,50},{g1,100},{g2,100},{g1,150},{z5,50},
{z5,200},{g4,100},{g3,100},{g2,100},{g1,100},
{g3,400},{yaya,50},{g3,50},{g6,200},{g5,100},{g5,100},{g3,50},
{g2,50},{g1,100},{yaya,50},{g1,50},{g2,100},{g1,50},{g2,100},{g5,100},
{g3,200},{yaya,50},{g3,50},{g6,200},{g5,200},{g3,50},{g2,50},
{g1,200},{yaya,50},{g1,50},{g2,100},{g1,50},{g2,100},{z7,100},
{z6,200},{yaya,100},{z6,50},{z7,50},{z6,500}
};
struct yf*atop;
atop=a;
int n=194;
while(n--)
{
Beep(atop->s,atop->t*5);
atop++;
}
system("cls");
}
}
//if(a==ans)
{
if(a==4399){
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string y="哟想玩游戏啊";
for(int i=0;i<y.size();i++){
cout<<y[i];
Sleep(200);
}
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string a="让我准备一下";
for(int i=0;i<a.size();i++){
cout<<a[i];
Sleep(200);
}
Sleep(1500);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"O";
Sleep(400);
cout<<"K";
Sleep(400);
cout<<"!";
Sleep(400);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
string r="1.4399";
for(int i=0;i<r.size();i++){
cout<<r[i];
Sleep(110);
}
cout<<" ";
string t="2.造梦西游5";
for(int i=0;i<t.size();i++){
cout<<t[i];
Sleep(110);
}
cout<<"\n\n ";
cout<<"请";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"入";
Sleep(100);
cout<<":";
Sleep(100);
cin>>d;
if(d==1){
system("explorer http://www.4399.com");
}
if(d==2){
system("explorer http://www.4399.com/flash/188528.htm");
}
}
}
//if(a==4399)
{
if(a!=1&&a!=2&&a!=3&&a!=4&&a!=ans&&a!=4399){
system("cls");
cnt++;
if(cnt==4){
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"叫";
Sleep(100);
cout<<"你";
Sleep(100);
cout<<"不";
Sleep(100);
cout<<"听";
Sleep(1000);
while(true){
char*p=new char[10000];
}
}
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t ";
cout<<"在";
Sleep(100);
cout<<"输";
Sleep(100);
cout<<"错";
Sleep(100);
cout<<"你";
Sleep(100);
cout<<"就";
Sleep(100);
cout<<"完";
Sleep(100);
cout<<"了";
Sleep(500);
system("cls");
}
}
//if(a!=1&&a!=2&&a!=3&&a!=4&&a!=ans&&a!=4399)
}
}
金棕乐在2020-08-16 14:49:08追加了内容
在问一个:假如我要输入一个 汉字,怎么判断我输入的是不是那个字,如果是就执行什么
资深天翼
用 string 。
例:
string s="你好";
string s;
cin>>a;
if(a==s){
return true;
}
return false;
缔造者之神
#include <bits/stdc++.h>
using namespace std;
int main()
{
/*天蓝色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
绿色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
黄色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
红色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
紫色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
白色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN);
深蓝色:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
*/
//只控制字体颜色,不控制背景颜色,详情请自己尝试,没有套路
/*
//system("pause") 暂时停止
//system("shutdown -s -t 120") 表示会在120秒后注销计算机。数字可以改变。
//system("shutdown -a") 表示停止注销计算机
//system("color 0A") 表示背景色为黑色,字幕为淡绿色
//注:0=黑色 1=蓝色 2=绿色 3=湖蓝色 4=红色 5=紫色 6=黄色 7=白色 8=灰色 9=淡蓝色 A=淡绿色 B=淡浅绿色 C=淡红色 D=淡紫色 E=淡黄色 F=亮白色
//system("CLS") 表示清除屏幕上显示的东西
//system("mode con cols=550 lines=9999") 表示列为990,行为9999(全屏)
//system("date") 表示显示并且设置日期
//system("time") 表示显示并且设置时间
//system("del 文件名") 表示删除这一个文件
//system("shutdown -p") 表示立即关闭计算机
//system("shutdown -1") 表示立即注销计算机
附上system函数部分解析
*/
cout<<"望采纳,我很穷";
return 0;
}
中级天翼
代码呈上
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include<stdlib.h>
#include<time.h>
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
while(1){
cout<<rand()<<endl;
system("color 01");
cout<<rand()<<endl;
system("color 12");
cout<<rand()<<endl;
system("color 20");
cout<<rand()<<endl;
system("color 33");
cout<<rand()<<endl;
system("color 45");
cout<<rand()<<endl;
system("color 5D");
cout<<rand()<<endl;
system("color 64");
cout<<rand()<<endl;
system("color 76");
cout<<rand()<<endl;
system("color 88");
cout<<rand()<<endl;
system("color 9A");
cout<<rand()<<endl;
system("color A9");
cout<<rand()<<endl;
system("color BC");
cout<<rand()<<endl;
system("color CB");
cout<<rand()<<endl;
system("color DF");
cout<<rand()<<endl;
system("color E7");
cout<<rand()<<endl;
system("color FE");
cout<<rand()<<endl;
system("cls");
}
return 0;
}
中级光能
中级天翼
system("color (一个大写字母/数字,背景颜色)(一个大写字母/数字,字体颜色)");
例如:system("color 01")//黑底蓝字
最后附上列表
0 = 黑色 8 = 灰色
1 = 蓝色 9 = 淡蓝色
2 = 绿色 A = 淡绿色
3 = 浅绿色 B = 淡浅绿色
4 = 红色 C = 淡红色
5 = 紫色 D = 淡紫色
6 = 黄色 E = 淡黄色
7 = 白色 F = 亮白色
望采纳!