资深光能
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
void gotoxy(int,int);
void full_screen();
void hidegd();
int setcolor(int,int,int);
void hideCursor();
void vertical(string,string,int,char);
void PLUSvt(string,string,int);
void spaceprint(string,bool,char);
void chushihua();
void chushihua()
{
system("cls");
gotoxy(0,0);
}
void font(int x)
{
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize=sizeof(cfi);
cfi.nFont=0;
cfi.dwFontSize.X=0;
cfi.dwFontSize.Y=x;
cfi.FontFamily=FF_DONTCARE;
cfi.FontWeight=FW_NORMAL;
std::wcscpy(cfi.FaceName, L"Consolas");
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
}
void full_screen()
{
HWND hwnd=GetForegroundWindow();
int cx=GetSystemMetrics(SM_CXSCREEN);
int cy=GetSystemMetrics(SM_CYSCREEN);
LONG l_WinStyle=GetWindowLong(hwnd,GWL_STYLE);
SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle | WS_POPUP | WS_MAXIMIZE) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER);
SetWindowPos(hwnd,HWND_TOP,0,0,cx,cy,0);
}
void gotoxy(int x,int y)
{
COORD c;
c.X=x;
c.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}
template<typename T>
void ColorCout(T t, const int ForeColor = 7, const int BackColor = 0)
{
// 0 = 黑色 1 = 蓝色 2 = 绿色 3 = 浅绿色 4 = 红色 5 = 紫色 6 = 黄色 7 = 白色
// 8 = 灰色 9 = 淡蓝色 10 = 淡绿色 11 = 淡浅绿色 12 = 淡红色 13 = 淡紫色 14 = 淡黄色 15 = 亮白色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),ForeColor+BackColor*0x10);
cout<<t;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0+15*0x10);
}
void hideCursor()
{
CONSOLE_CURSOR_INFO cursorInfo;
GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursorInfo);
cursorInfo.bVisible=FALSE;
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursorInfo);
}
string qqqdl(string s)
{
while(s[0]=='0'&&s.size()>1)s.erase(0,1);
return s;
}
void PLUSvt(string a,string b,int jinzhi)/*40位*/
{
chushihua();
a=qqqdl(a);
b=qqqdl(b);
string ans="";
string s=" ";
int x=max(a.size(),b.size());
if(a.size()>b.size()||a.size()==b.size()&&a>b)swap(a,b);
int temp=b.size()-a.size();
for(int i=1; i<=temp; i++)a=' '+a;
spaceprint(a,1,'+');
spaceprint(b,0,'+');
for(int i=1; i<=x*2+3; i++)cout<<"-";
int carry=0;
for(; x!=0;)
{
gotoxy(0,6);
cout<<"请按任意键继续";
gotoxy(0,4);
if(carry!=0)cout<<"前一位有进位,进了"<<carry<<'\n';
else cout<<"无进位 \n";
if(a[x-1]==' ')a[x-1]='0';
int jia1,jia2;
if(isupper(a[x-1]))jia1=a[x-1]-'A'+10;
else if(islower(a[x-1]))jia1=a[x-1]-'a'+10;
else jia1=a[x-1]-'0';
if(isupper(b[x-1]))jia2=b[x-1]-'A'+10;
else if(islower(b[x-1]))jia2=b[x-1]-'a'+10;
else jia2=b[x-1]-'0';
int t=jia1+jia2+carry;
cout<<s;
gotoxy(0,5);
if(carry!=0)cout<<a[x-1]<<"+"<<b[x-1]<<"+"<<carry<<"=";
else cout<<a[x-1]<<"+"<<b[x-1]<<"=";
if(t>=jinzhi)
{
cout<<1;
if(t%jinzhi>=10)cout<<char(t%jinzhi-10+'A');
else cout<<t%jinzhi;
}
else
{
if(t%jinzhi>=10)cout<<char(t%jinzhi-10+'A');
else cout<<t%jinzhi;
}
int out=t%jinzhi;
gotoxy(2*x+1,3);
if(out>=10)
{
ColorCout(char(out-10+'A'),6,9);
ans=char(out-10+'A')+ans;
}
else
{
ColorCout(out,6,9);
ans=char(out+'0')+ans;
}
carry=t/jinzhi;
getch();
gotoxy(2*x+1,3);
if(out>=10)ColorCout(char(out-10+'A'),0,15);
else ColorCout(out,0,15);
x--;
}
if(carry!=0)
{
gotoxy(0,6);
cout<<"请按任意键继续";
gotoxy(0,4);
cout<<"前一位有进位,进了"<<carry<<'\n';
cout<<s;
gotoxy(1,3);
cout<<carry;
getch();
ans=char(carry+'0')+ans;
}
system("cls");
gotoxy(0,0);
cout<<"计算结束!\n";
cout<<"计算结果:"<<ans<<'\n';
cout<<"请按任意键继续";
getch();
}
void MINUSvt(string a,string b,int jinzhi)
{
bool fushu=0;
chushihua();
a=qqqdl(a);
b=qqqdl(b);
string ans="";
string s=" ";
int x=max(a.size(),b.size());
if(b.size()>a.size()||b.size()==a.size()&&b>a)fushu=1;
else swap(a,b);
int temp=b.size()-a.size();
for(int i=1; i<=temp; i++)a=' '+a;
spaceprint(b,1,'-');
spaceprint(a,0,'-');
for(int i=1; i<=x*2+3; i++)cout<<"-";
int carry=0;
for(; x!=0;)
{
gotoxy(0,7);
cout<<"请按任意键继续";
gotoxy(0,4);
if(carry!=0)cout<<"被借位,借走"<<carry<<'\n';
else cout<<"不被借位 \n";
if(a[x-1]==' ')a[x-1]='0';
int jian1,jian2;
if(isupper(a[x-1]))jian1=a[x-1]-'A'+10;
else if(islower(a[x-1]))jian1=a[x-1]-'a'+10;
else jian1=a[x-1]-'0';
if(isupper(b[x-1]))jian2=b[x-1]-'A'+10;
else if(islower(b[x-1]))jian2=b[x-1]-'a'+10;
else jian2=b[x-1]-'0';
int t=jian2-jian1-carry;
cout<<'\n';
cout<<s;
gotoxy(0,6);
if(carry!=0)
{
if(t>=0)
{
cout<<b[x-1]<<"-"<<a[x-1]<<"-"<<carry<<"=";
carry=0;
}
else
{
cout<<b[x-1]<<"-"<<a[x-1]<<"-"<<carry<<"+"<<jinzhi<<"=";
carry=1;
}
}
else
{
if(t>=0)
{
cout<<b[x-1]<<"-"<<a[x-1]<<"=";
carry=0;
}
else
{
cout<<b[x-1]<<"-"<<a[x-1]<<"+"<<jinzhi<<"=";
carry=1;
}
}
if(t<0)
{
t+=jinzhi;
if(t>=10)cout<<char(t%jinzhi-10+'A');
else cout<<t%jinzhi;
}
else
{
if(t>=10)cout<<char(t%jinzhi-10+'A');
else cout<<t%jinzhi;
}
int out=t;
gotoxy(2*x+1,3);
if(out>=10)
{
ColorCout(char(out-10+'A'),6,9);
ans=char(out-10+'A')+ans;
}
else
{
ColorCout(out,6,9);
ans=char(out+'0')+ans;
}
if(carry==1)
{
gotoxy(0,5);
cout<<"需借位,借来"<<jinzhi;
}
else
{
gotoxy(0,5);
cout<<"无需借位 ";
}
getch();
gotoxy(2*x+1,3);
if(out>=10)ColorCout(char(out-10+'A'),0,15);
else ColorCout(out,0,15);
x--;
}
if(fushu)
{
gotoxy(0,7);
cout<<"请按任意键继续";
gotoxy(0,4);
cout<<s;
gotoxy(0,5);
cout<<s;
gotoxy(0,6);
cout<<s;
gotoxy(0,4);
cout<<"是负数"<<'\n';
gotoxy(1,3);
cout<<'-';
getch();
}
system("cls");
gotoxy(0,0);
ans=qqqdl(ans);
cout<<"计算结束!\n";
cout<<"计算结果:"<<(fushu?'-'+ans:ans)<<'\n';
cout<<"请按任意键继续";
getch();
}
char cl(int x)
{
if(x<10)return char(x+'0');
else return char(x-10+'A');
}
void jishuqi(int jinzhi)
{
st:
int b[15];
memset(b,0,sizeof(b));
chushihua();
for(int i=1; i<=jinzhi; i++)cout<<" | | | | | | | | | | | |\n";
cout<<"序号:12 11 10 9 8 7 6 5 4 3 2 1\n";
printf("数值:%d %d %d %d %d %d %d %d %d %d %d %d\n",b[12],b[11],b[10],b[9],b[8],b[7],b[6],b[5],b[4],b[3],b[2],b[1]);
cout<<"命令:\n";
cout<<"按I:加上一个数\n按E:减去一个数\n按A:在某个数位上操作\n按X:退出";
bool firstget=0;
while(1)
{
char c=getch();
if(c=='i'||c=='I')
{
string s;
gotoxy(70,0);
cout<<"请输入一个数:";
gotoxy(65,1);
if(firstget==0)getline(cin,s),firstget=1;
getline(cin,s);
int flag=1;
while(s.size()>12)
{
s.erase(0,1);
flag=0;
}
if(!flag)MessageBox(NULL,"超出范围!(超出后只保留不超出的部分)","错误",MB_OK);
gotoxy(65,1);
cout<<" ";
gotoxy(70,0);
cout<<" ";
gotoxy(65,1);
int t=0;
for(int i=s.size()-1; i>=0; i--)
{
if(isdigit(s[i]))b[++t]+=s[i]-'0';
else if(isupper(s[i]))b[++t]+=s[i]-'A'+10;
else if(islower(s[i]))b[++t]+=s[i]-'a'+10;
if(b[t]>=jinzhi)
{
b[t]-=jinzhi;
if(t+1<=12)b[t+1]++;
else MessageBox(NULL,"超出范围!(超出后只保留不超出的部分)","错误",MB_OK);
}
}
for(int i=12; i>=1; i--)
{
if(b[13-i]>=jinzhi)
{
b[13-i]-=jinzhi;
if(i!=1)b[14-i]++;
else MessageBox(NULL,"超出范围!(超出后只保留不超出的部分)","错误",MB_OK);
}
for(int j=1; j<=jinzhi-1; j++)
{
gotoxy(5*i-1,jinzhi-j);
if(j<=b[13-i])cout<<"[ ]";
else cout<<" | ";
}
}
}
else if(c=='E'||c=='e')
{
string s;
gotoxy(70,0);
cout<<"请输入一个数:";
gotoxy(65,1);
if(firstget==0)getline(cin,s),firstget=1;
getline(cin,s);
int flag=1;
while(s.size()>12)
{
s.erase(0,1);
flag=0;
}
if(!flag)
{
MessageBox(NULL,"数会小于零!(清零)","错误",MB_OK);
goto st;
}
gotoxy(65,1);
cout<<" ";
gotoxy(70,0);
cout<<" ";
gotoxy(65,1);
int t=0;
for(int i=s.size()-1; i>=0; i--)
{
if(isdigit(s[i]))b[++t]-=s[i]-'0';
else if(isupper(s[i]))b[++t]-=s[i]-'A'+10;
else if(islower(s[i]))b[++t]-=s[i]-'a'+10;
if(b[t]<0)
{
b[t]+=jinzhi;
if(t+1<=12)b[t+1]--;
else MessageBox(NULL,"超出范围!(超出后只保留不超出的部分)","错误",MB_OK);
}
}
for(int i=12; i>=1; i--)
{
if(b[13-i]<0)
{
b[13-i]+=jinzhi;
if(i!=1)b[14-i]--;
else
{
MessageBox(NULL,"数会小于零!(清零)","错误",MB_OK);
goto st;
}
}
for(int j=1; j<=jinzhi-1; j++)
{
gotoxy(5*i-1,jinzhi-j);
if(j<=b[13-i])cout<<"[ ]";
else cout<<" | ";
}
}
}
else if(c=='A'||c=='a')
{
Aa:
string s;
gotoxy(70,0);
cout<<"请输入您要操作的数位的序号:";
gotoxy(65,1);
int ttt;
cin>>ttt;
if(ttt>12||ttt<1)
{
MessageBox(NULL,"错误!(请重新输入)","错误",MB_OK);
gotoxy(70,0);
cout<<" ";
gotoxy(65,1);
cout<<" ";
goto Aa;
}
gotoxy(65,1);
cout<<" ";
gotoxy(70,0);
cout<<" ";
gotoxy(70,0);
cout<<"按1加算珠,按2减算珠";
char tmp=getch();
gotoxy(70,0);
cout<<" ";
if(tmp=='1')
{
tmp1cw:
gotoxy(70,0);
cout<<"请输入您要加的算珠数目(小于"<<jinzhi<<"):";
gotoxy(65,1);
int xxx;
cin>>xxx;
gotoxy(70,0);
cout<<" ";
gotoxy(65,1);
cout<<" ";
if(xxx>jinzhi)
{
MessageBox(NULL,"错误!(请重新输入)","错误",MB_OK);
goto tmp1cw;
}
b[ttt]+=xxx;
for(int i=12; i>=1; i--)
{
if(b[13-i]>=jinzhi)
{
b[13-i]-=jinzhi;
if(i!=1)b[14-i]++;
else MessageBox(NULL,"超出范围!(超出后只保留不超出的部分)","错误",MB_OK);
}
for(int j=1; j<=jinzhi-1; j++)
{
gotoxy(5*i-1,jinzhi-j);
if(j<=b[13-i])cout<<"[ ]";
else cout<<" | ";
}
}
}
else if(tmp=='2')
{
tmp2cw:
gotoxy(70,0);
cout<<"请输入您减的算珠数目(小于"<<jinzhi<<"):";
gotoxy(65,1);
int xxx;
cin>>xxx;
if(xxx>jinzhi)
{
MessageBox(NULL,"错误!(请重新输入)","错误",MB_OK);
goto tmp2cw;
}
gotoxy(70,0);
cout<<" ";
gotoxy(65,1);
cout<<" ";
b[ttt]-=xxx;
for(int i=12; i>=1; i--)
{
if(b[13-i]<0)
{
b[13-i]+=jinzhi;
if(i!=1)b[14-i]--;
else
{
MessageBox(NULL,"数会小于零!(清零)","错误",MB_OK);
goto st;
}
}
for(int j=1; j<=jinzhi-1; j++)
{
gotoxy(5*i-1,jinzhi-j);
if(j<=b[13-i])cout<<"[ ]";
else cout<<" | ";
}
}
}
}
else if(c=='x'||c=='X')
{
system("cls");
break;
}
end:
gotoxy(0,jinzhi+1);
printf("数值:%c %c %c %c %c %c %c %c %c %c %c %c\n",cl(b[12]),cl(b[11]),cl(b[10]),cl(b[9]),cl(b[8]),cl(b[7]),cl(b[6]),cl(b[5]),cl(b[4]),cl(b[3]),cl(b[2]),cl(b[1]));
}
}
void spaceprint(string s,bool a,char c)
{
if(a==1)cout<<" ";
else cout<<" "<<c;
for(int i=0; i<s.size(); i++)cout<<" "<<s[i];
cout<<'\n';
return;
}
int main()
{
short state1=GetKeyState(VK_CAPITAL);
short state2=GetKeyState(VK_NUMLOCK);
if(state1&0x1);
else
{
keybd_event(VK_CAPITAL,0,0,0);
keybd_event(VK_CAPITAL,0,2,0);
}
if(state2&0x1);
else
{
keybd_event(VK_NUMLOCK,0,0,0);
keybd_event(VK_NUMLOCK,0,2,0);
}
full_screen();
system("color F0");
hideCursor();
font(36);
while(1)
{
start:
system("cls");
cout<<"进制加法(竖式演示):按1\n进制减法(竖式演示):按2\n进制计数器:按3\n退出:按4\n";
char c=getch();
if(c=='1')
{
system("cls");
cout<<"请输入两个数\n";
string a,b;
cin>>a>>b;
srjf:
system("cls");
cout<<"请输入进制:(不超过36)\n";
int tt;
cin>>tt;
if(tt>36)
{
cout<<"错误!请重新输入!";
Sleep(1000);
goto srjf;
}
PLUSvt(a,b,tt);
}
else if(c=='2')
{
system("cls");
cout<<"请输入两个数\n";
string a,b;
cin>>a>>b;
srjif:
system("cls");
cout<<"请输入进制:(不超过36)\n";
int tt;
cin>>tt;
if(tt>36)
{
cout<<"错误!请重新输入!";
Sleep(1000);
goto srjif;
}
MINUSvt(a,b,tt);
}
else if(c=='3')
{
jsq:
system("cls");
cout<<"请输入进制:(不超过36)\n";
int tt;
cin>>tt;
if(tt>36)
{
cout<<"错误!请重新输入!";
Sleep(1000);
system("cls");
goto jsq;
}
jishuqi(tt);
}
else if(c=='4')
{
cout<<"欢迎下次使用,再见!";
break;
}
else
{
cout<<"错误!";
Sleep(1000);
goto start;
}
}
}
代码如上,运行环境devc++5.11
王梓轩在2024-03-01 17:26:04追加了内容
ding
王梓轩在2024-03-02 09:07:57追加了内容
王梓轩在2024-03-02 09:08:17追加了内容
???
王梓轩在2024-03-03 14:10:44追加了内容
每个人的代码我都会看,如果想发的话可以在下面发
王梓轩在2024-03-03 15:24:49追加了内容
我会把把所有人的代码放在这里供大家观赏
王梓轩在2024-03-05 21:40:09追加了内容
这是一个:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a,b,c,n,cnt;
void setpos(int x,int y){
HANDLE output=GetStdHandle(STD_OUTPUT_HANDLE);
COORD pos={x,y};
SetConsoleCursorPosition(output,pos);
}
void zhuanzhulixvnlian(){
int x=50,y=3;
setpos(x,y);
int d;
cout<<"消 失 的 数 字\n";
cout<<" \n";
cout<<" 玩法说明:请输入关卡序号数字,选择游戏难度等级,并按Enter键进入\n";
cout<<" \n";
cout<<" 每轮游戏随机出现一组数字,2秒消失,请依次输入该组数字,用空格键隔开,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" 难度等级: 1.第一关 2.第二关 3.第三关\n";
cout<<" \n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
exit(0);
}
}
while(true){
if(cnt>=5){
cnt=0;
system("cls");//清屏
if(n==10){
cout<<" 恭喜你,进入第二关\n";
n=20;
}else if(n==20){
cout<<" 恭喜你,进入第三关\n";
n=100;
}
Sleep(1000);//等待1s
system("cls");//清屏
}
srand(time(NULL));//函数初始化随机数种子
a=rand()%n+1;//生成随机数
b=rand()%n+1;//生成随机数
c=rand()%n+1;//生成随机数
cout<<" ";
cout<<" \n";
cout<<" ";
cout<<a<<" "<<b<<" "<<c<<"\n";
Sleep(2000);//等待2s
system("cls");//清屏
cout<<" ";
int a1,b1,c1;
cin>>a1>>b1>>c1;
if(a1==a&&b1==b&&c1==c){
char t;
cout<<" 恭喜你答对了!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt++;
cout<<" ";
cin>>t;
system("cls");//清屏
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
}else{
char t;
cout<<" 不对哦!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt=0;
cout<<" ";
cin>>t;
system("cls");//清屏
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
}
}
}
void kousuannenglixvnlian(){
int x=50,y=3;
setpos(x,y);
int d;
cout<<"口 算 天 天 练\n";
cout<<" \n";
cout<<" 玩法说明:请输入关卡序号数字,选择游戏难度等级,并按Enter键进入\n";
cout<<" \n";
cout<<" 随机出现一个算式,请口算并输入得数,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" 难度等级: 1.第一关(10以内加减法) 2.第二关(20以内加减法) 3.第三关(50以内加减法) 4.第四关(100以内加减法)\n";
cout<<" \n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=50;
}else if(d==4){
n=100;
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
exit(0);
}
}
while(true){
if(cnt>=5){
cnt=0;
system("cls");//清屏
if(n==10){
cout<<" 恭喜你,进入第二关\n";
n=20;
}else if(n==20){
cout<<" 恭喜你,进入第三关\n";
n=50;
}else{
cout<<" 恭喜你,进入第四关\n";
n=100;
}
Sleep(1000);//等待1s
system("cls");//清屏
}
system("cls");//清屏
srand(time(NULL));//函数初始化随机数种子
int fh=rand()%2+1;
char ysfh;
a=rand()%n+1;//生成随机数
b=rand()%n+1;//生成随机数
if(a<b){
swap(a,b);
}
int correct_ans,input_ans;
if(fh==1){
ysfh='+';
correct_ans=a+b;
}else{
ysfh='-';
correct_ans=a-b;
}
cout<<" \n";
cout<<" \n";
cout<<" ";
cout<<a<<ysfh<<b<<"=";
cin>>input_ans;
cout<<"\n";
if(input_ans==correct_ans){
cnt++;
cout<<" 恭喜你答对了!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cout<<" \n";
char t;
cout<<" ";
cin>>t;
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
system("cls");//清屏
}else{
char t;
cout<<" 不对哦!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt=0;
cout<<" ";
cin>>t;
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
system("cls");//清屏
}
}
}
int main(){
cout<<"\n";
cout<<"\n";
cout<<"\n";
int x=50,y=3;
setpos(x,y);
cout<<"专 注 力 训 练\n";
cout<<" \n";
cout<<" 特别说明:请您仔细阅提示语,并按要求输入数字或字母,否则将自动退出程序\n";
cout<<" \n";
cout<<" 选择模式:\n";
cout<<" \n";
cout<<" 输入数字“1”并按Enter键进入“消失的数字” 输入数字“2”并按Enter键进入“口算天天练”\n";
cout<<" \n";
cout<<" \n";
cout<<" \n";
cout<<" 模式说明:\n";
cout<<" \n";
cout<<" 1.消失的数字:\n";
cout<<" \n";
cout<<" 玩法:每轮游戏随机出现一组数字,2秒消失,请依次输入该组数字,用空格键隔开,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" \n";
cout<<" 2.口算天天练:\n";
cout<<" \n";
cout<<" 玩法:随机出现一个算式,请口算并输入得数,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" \n";
int f;
cout<<" ";
cin>>f;
if(f==1){
system("cls");//清屏
zhuanzhulixvnlian();
}else if(f==2){
system("cls");//清屏
kousuannenglixvnlian();
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
int f;
cin>>f;
if(f==1){
system("cls");//清屏
zhuanzhulixvnlian();
}else if(f==2){
system("cls");//清屏
kousuannenglixvnlian();
}else{
exit(0);
}
}
return 0;
}
这又是一个:
#include<bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
#include <time.h>
#include <windows.h>
#include <pthread.h>
#include <conio.h>
#include <vector>
#include <map>
#define CgDu 5000
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME)&0x8000)?1:6)
#include <cwchar>
using namespace std;
string s="现在是2123年2月14日,你乘坐着旅行者23号火箭去麦兹星执行任务,但飞行过程中,火箭被一个陨石击中,你幸运的活了下来,不过火箭失控,撞上了一个未知星球,你现在的任务就是:收集燃料,发射火箭,重返地球。";
int dt[30][27] = {//0=空气 1=石头 3=地面 4=燃料
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//1
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//2
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//3
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//4
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//5
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//6
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//7
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//8
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//9
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//10
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//11
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//12
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//13
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//14
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//15
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//16
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//17
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//18
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//19
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//20
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//21
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//22
{0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//23
{0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//24
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//25
{50, 70, 100, 2, 2, 100, 2, 2, 2, 25, 2, 2, 100, 2, 2, 2, 2, 2, 2, 100, 2, 100, 2, 100, 2, 90, 8},//26
{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8},//27
{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8},//28
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8},//29
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8} //30
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
};
long long b,jb,z1=24,z2=15,cj=1,bj=100,hj=1,dd,cjb,ss=1,cs,q,xh=1;
char c;
HANDLE hOut;
int main(){
srand(time(0));
int x = rand() % 6 + 1;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTitle("火箭模拟器 1.5.2");
system("color 0F");
cout<<"按1打开引入片,按2开始游戏";
c=getch();
if(c=='1'){
system("cls");
for (int i=0;i<s.size() ;i++ ){
if(s[i-1]==','){
cout<<endl;
Sleep(200);
}
cout<<s[i];
Sleep(70);
}
Sleep(3000);
cout<<"按任意数字开始游戏";
c=getch();
}else{
system("cls");
}
system("cls");
while(1){
system("cls");
for(int i=0;i<=29;i++){
for(int j=0;j<=26;j++){
if(xh==1){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
}else if(xh==2||xh==3){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
}else if(xh==4||xh==5){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
if(dt[i][j]==11){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("##");
}
}else if(xh==6||xh==7){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
if(dt[i][j]==11){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("##");
}
if(dt[i][j]==12){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("EE");
}
}
}
cout<<endl;
}
c=getch();
if(c=='a'&&z2!=0){
dt[z1][z2]=0;
z2--;
dt[z1][z2]=6;
}
if(c=='d'&&z2!=25){
dt[z1][z2]=0;
z2++;
dt[z1][z2]=6;
}
if(c=='x'){
if(dt[z1+1][z2]<=100&&dt[z1+1][z2]>=20){
b+=cj;
Sleep(150);
dt[z1+1][z2]--;
}else if(dt[z1+1][z2]==10){
q+=35;
Sleep(500);
dt[z1+1][z2]=2;
}else if(dt[z1+1][z2]==11){
q+=100;
Sleep(800);
dt[z1+1][z2]=2;
}else if(dt[z1+1][z2]==12){
b+=cj*20;
Sleep(900);
dt[z1+1][z2]=2;
}
}
if(c=='f'&&b!=0){
jb+=b;
b=0;
}
if(c=='s'&&jb!=0){
system("cls");
if(hj==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=2;
dd++;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
hj=0;
}
if(hj==2){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=3;
dd+=2;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==3){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=4;
dd+=4;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==4){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+8>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+8>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=6;
dd+=8;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==5){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+16>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+16>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+16>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+16>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+16>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+16>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=7;
dd+=16;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==6){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+25>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+25>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=8;
dd+=25;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==7){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+42>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+42>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+42>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+42>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+42>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+42>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=10;
dd+=42;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==8){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+70>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+70>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+70>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+70>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+70>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+70>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=12;
dd+=70;
Sleep(80);
}
cjb=0;
dd=0;
dt[20][6]=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==9){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+80>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+80>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+80>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+80>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+80>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+80>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=14;
dd+=80;
Sleep(80);
}
cjb=0;
dd=0;
dt[20][6]=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==10){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+90>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+90>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+90>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+90>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+90>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+90>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=19;
dd+=90;
Sleep(80);
}
cjb=0;
dd=0;
dt[18][6]=0;
dt[19][6]=0;
dt[20][6]=0;
dt[21][6]=0;
dt[21][5]=0;
dt[21][7]=0;
dt[23][6]=0;
dt[22][5]=0;
dt[22][6]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
}
if(c=='c'){
system("cls");
while(1){
if(ss==1){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 新手稿子 ★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("_____");
cout<<endl;
printf (" L ");
cout<<endl;
printf (" ----|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 0$ 6=买 1个/次");
cout<<endl;
printf ("3=退出");
}
if(ss==2){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 普通稿子 ★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("____+");
cout<<endl;
printf (" L ");
cout<<endl;
printf (" +===|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 120$ 6=买 2个/次 ");
cout<<endl;
printf ("3=退出");
}
if(ss==3){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 中级稿子 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("=-__+");
cout<<endl;
printf (" R ");
cout<<endl;
printf (" +===|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 660$ 6=买 3个/次");
cout<<endl;
printf ("3=退出");
}
if(ss==4){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 高级稿子 ★★★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("=----+");
cout<<endl;
printf (" R ");
cout<<endl;
printf (" +===|EEEE|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 990$ 6=买 4个/次 次页为最后一面");
cout<<endl;
printf ("3=退出");
}
c=getch();
if(c=='1'){
ss++;
}
if(c=='0'){
ss--;
}
if(ss==5){
ss=1;
}
if(ss==0){
ss=4;
}
if(c=='3'){
ss=1;
break;
}
if(ss==1&&c=='6'){
cj=1;
break;
}
if(ss==2&&c=='6'&&q>=20){
cj=2;
q-=120;
break;
}
if(ss==3&&c=='6'&&q>=30){
cj=3;
q-=660;
break;
}
if(ss==4&&c=='6'&&q>=40){
cj=4;
q-=990;
break;
}
}
}
if(c=='m'){
system("cls");
while(1){
if(ss==1){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 新手火箭 ★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 0$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==2){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 简易火箭 ★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 50$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==3){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 普通火箭 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 150$ 6=买 ");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==4){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 开天号 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 250$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==5){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 开天号(升级版)★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
printf (" A ");
cout<<endl;
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" 300$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==6){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 银河号★★★");
cout<<"钱数"<<q;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" A ");
cout<<endl;
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 400$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==7){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 银河号(升级版)★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
printf (" AAA ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 550$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==8){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 宙斯号 ★★★★");
cout<<"钱数"<<q;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" 550$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==9){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 宙斯号(升级版) ★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" AAA ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 600$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==10){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 创世神号 ★★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
printf (" H ");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" AAA ");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" 900$ 6=买 次页为最后一面");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
c=getch();
if(c=='1'&&ss!=10){
ss++;
}else if(c=='1'&&ss==10){
ss=1;
}else if(c=='0'&&ss==1){
ss=10;
}else if(c=='0'&&ss!=1){
ss--;
}else if(c=='0'){
ss--;
}else if(c=='3'){
ss=1;
break;
}
if(c=='6'&&ss==1){
dt[23][6]=4;
dt[22][6]=5;
hj=1;
break;
}
if(c=='6'&&ss==2&&q>=50){
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=5;
dt[23][7]=5;
q-=50;
hj=2;
break;
}
if(c=='6'&&ss==3&&q>=150){
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=150;
hj=3;
break;
}
if(c=='6'&&ss==4&&q>=250){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=4;
dt[23][5]=5;
dt[23][7]=5;
q-=250;
hj=4;
break;
}
if(c=='6'&&ss==5&&q>=300){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=5;
dt[23][7]=5;
q-=300;
hj=5;
break;
}
if(c=='6'&&ss==6&&q>=400){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=400;
hj=6;
break;
}
if(c=='6'&&ss==7&&q>=550){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=550;
hj=7;
break;
}
if(c=='6'&&ss==8&&q>=600){
dt[20][6]=5;
dt[21][6]=4;
dt[23][6]=4;
dt[22][6]=4;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=600;
hj=8;
break;
}
if(c=='6'&&ss==9&&q>=700){
dt[20][6]=5;
dt[21][6]=4;
dt[23][6]=4;
dt[22][6]=5;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=700;
hj=9;
break;
}
if(c=='6'&&ss==10&&q>=900){
dt[18][6]=5;
dt[19][6]=4;
dt[20][6]=4;
dt[21][6]=4;
dt[21][5]=5;
dt[21][7]=5;
dt[23][6]=4;
dt[22][6]=4;
dt[22][5]=4;
dt[22][7]=4;
dt[23][5]=4;
dt[23][7]=4;
q-=900;
hj=10;
break;
}
}
}
}
return 0;
}
再来一个:
#include<iostream>
#include<windows.h>
#include<cmath>
using namespace std;
long double sz1,sz2,jieguo;
char fuhao;
void jia(){
string message=to_string(sz1)+"+"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void jian(){
string message=to_string(sz1)+"-"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void cheng(){
string message=to_string(sz1)+"×"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void chu(){
string message=to_string(sz1)+"÷"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void mi(){
string message=to_string(sz1)+"^"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void mann(){
MessageBox(NULL,"此计算器支持 + - × ÷ ^ (+ - * / ^)","计算器",MB_OK);
MessageBox(NULL,"此计算器会将等式数字与结果自动保留六位小数","计算器",MB_OK);
MessageBox(NULL,"请在控制台输入等式","计算器",MB_OK);
cin>>sz1>>fuhao>>sz2;
if(fuhao=='+'){
jieguo=sz1+sz2;
jia();
}
if(fuhao=='-'){
jieguo=sz1-sz2;
jian();
}
if(fuhao=='*'){
jieguo=sz1*sz2;
cheng();
}
if(fuhao=='/'){
jieguo=sz1/sz2;
chu();
}
if(fuhao=='^'){
jieguo=(long double)(pow(sz1,sz2));
mi();
}
system("cls");
MessageBox(NULL,"继续计算……","计算器",MB_OK);
mann();
}
int main() {
system("title 计算器");
mann();
return 0;
}
高级守护
这是我的
火箭模拟器:
#include<bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
#include <time.h>
#include <windows.h>
#include <pthread.h>
#include <conio.h>
#include <vector>
#include <map>
#define CgDu 5000
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME)&0x8000)?1:6)
#include <cwchar>
using namespace std;
string s="现在是2123年2月14日,你乘坐着旅行者23号火箭去麦兹星执行任务,但飞行过程中,火箭被一个陨石击中,你幸运的活了下来,不过火箭失控,撞上了一个未知星球,你现在的任务就是:收集燃料,发射火箭,重返地球。";
int dt[30][27] = {//0=空气 1=石头 3=地面 4=燃料
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//1
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//2
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//3
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//4
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//5
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//6
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//7
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//8
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//9
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//10
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//11
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//12
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//13
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//14
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//15
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//16
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//17
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//18
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//19
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//20
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//21
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//22
{0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//23
{0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//24
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8},//25
{50, 70, 100, 2, 2, 100, 2, 2, 2, 25, 2, 2, 100, 2, 2, 2, 2, 2, 2, 100, 2, 100, 2, 100, 2, 90, 8},//26
{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8},//27
{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8},//28
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8},//29
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8} //30
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
};
long long b,jb,z1=24,z2=15,cj=1,bj=100,hj=1,dd,cjb,ss=1,cs,q,xh=1;
char c;
HANDLE hOut;
int main(){
srand(time(0));
int x = rand() % 6 + 1;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTitle("火箭模拟器 1.5.2");
system("color 0F");
cout<<"按1打开引入片,按2开始游戏";
c=getch();
if(c=='1'){
system("cls");
for (int i=0;i<s.size() ;i++ ){
if(s[i-1]==','){
cout<<endl;
Sleep(200);
}
cout<<s[i];
Sleep(70);
}
Sleep(3000);
cout<<"按任意数字开始游戏";
c=getch();
}else{
system("cls");
}
system("cls");
while(1){
system("cls");
for(int i=0;i<=29;i++){
for(int j=0;j<=26;j++){
if(xh==1){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
}else if(xh==2||xh==3){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
}else if(xh==4||xh==5){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
if(dt[i][j]==11){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("##");
}
}else if(xh==6||xh==7){
if(dt[i][j]==0){
printf (" ");
}
if(dt[i][j]==2||dt[i][j]==19){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("nn");
}
if(dt[i][j]==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
printf ("__");
}
if(dt[i][j]<=100&&dt[i][j]>=20){
SetConsoleTextAttribute(hOut,
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("==");
}
if(dt[i][j]==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("|");
if(i==2){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"背包燃料数"<<b;
}
if(i==3){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"火箭燃料数"<<jb;
}
if(i==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"钱数"<<q;
}
if(i==5&&jb>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按s可飞行";
}
if(i==5&&b>=1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按f可将背包燃料放入火箭";
}
if(i==7){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按m可买火箭";
}
if(i==8){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<" "<<"按c可买镐子";
}
}
if(dt[i][j]==6){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("♀ ");
}
if(dt[i][j]==4){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H ");
}
if(dt[i][j]==5){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
}
if(dt[i][j]==10){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("**");
}
if(dt[i][j]==11){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("##");
}
if(dt[i][j]==12){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN);
printf ("EE");
}
}
}
cout<<endl;
}
c=getch();
if(c=='a'&&z2!=0){
dt[z1][z2]=0;
z2--;
dt[z1][z2]=6;
}
if(c=='d'&&z2!=25){
dt[z1][z2]=0;
z2++;
dt[z1][z2]=6;
}
if(c=='x'){
if(dt[z1+1][z2]<=100&&dt[z1+1][z2]>=20){
b+=cj;
Sleep(150);
dt[z1+1][z2]--;
}else if(dt[z1+1][z2]==10){
q+=35;
Sleep(500);
dt[z1+1][z2]=2;
}else if(dt[z1+1][z2]==11){
q+=100;
Sleep(800);
dt[z1+1][z2]=2;
}else if(dt[z1+1][z2]==12){
b+=cj*20;
Sleep(900);
dt[z1+1][z2]=2;
}
}
if(c=='f'&&b!=0){
jb+=b;
b=0;
}
if(c=='s'&&jb!=0){
system("cls");
if(hj==1){
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=2;
dd++;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
hj=0;
}
if(hj==2){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=3;
dd+=2;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==3){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd==19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=4;
dd+=4;
Sleep(80);
}
cjb=0;
dd=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==4){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+8>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+8>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd==24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=6;
dd+=8;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==5){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+16>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+16>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+16>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+16>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+16>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+16>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=7;
dd+=16;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==6){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd==200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd==1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd==10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+25>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+25>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd==30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=8;
dd+=25;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==7){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+42>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+42>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+42>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+42>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+42>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+42>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=10;
dd+=42;
Sleep(80);
}
cjb=0;
dd=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==8){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+70>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+70>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+70>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+70>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+70>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+70>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=12;
dd+=70;
Sleep(80);
}
cjb=0;
dd=0;
dt[20][6]=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==9){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+80>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+80>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+80>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+80>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+80>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+80>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=14;
dd+=80;
Sleep(80);
}
cjb=0;
dd=0;
dt[20][6]=0;
dt[21][6]=0;
dt[23][6]=0;
dt[22][6]=0;
dt[22][5]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
if(hj==10){
cjb=jb;
for(int i=1;i<=cjb;i++){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
if(dd+90>=200){
cout<<"到达一个未知 星球(1)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=2;
dt[25][18]=10;
dt[25][10]=10;
break;
}else{
}
}else if(dd+90>=1000){
cout<<"到达一个未知 星球(2)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=3;
dt[25][18]=10;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=10;
dt[25][1]=10;
break;
}else{
}
}else if(dd+90>=10000){
cout<<"到达一个未知 星球(3)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=4;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=10;
dt[25][20]=11;
dt[25][1]=10;
dt[25][2]=11;
break;
}else{
}
}else if(dd+90>=19000){
cout<<"到达一个未知 星球(4)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=5;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=11;
dt[25][2]=11;
break;
}else{
}
}else if(dd+90>=24000){
cout<<"到达一个未知 星球(5)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=6;
dt[25][18]=11;
dt[25][10]=10;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=10;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd+90>=30000){
cout<<"到达一个未知 星球(6)";
cout<<endl<<"按1进入,按2不进入";
c=getch();
if(c=='1'){
xh=7;
dt[25][18]=11;
dt[25][10]=12;
dt[25][13]=11;
dt[25][20]=12;
dt[25][2]=11;
dt[25][19]=11;
dt[25][11]=11;
dt[25][12]=12;
dt[25][21]=11;
dt[25][23]=12;
break;
}else{
}
}else if(dd>=60000){
cout<<"到达地球!!!";
return 0;
}
cout<<"飞行中..."<<endl;
cout<<"火箭燃料数"<<jb;
cout<<" "<<"钱数"<<q;
jb--;
q+=19;
dd+=90;
Sleep(80);
}
cjb=0;
dd=0;
dt[18][6]=0;
dt[19][6]=0;
dt[20][6]=0;
dt[21][6]=0;
dt[21][5]=0;
dt[21][7]=0;
dt[23][6]=0;
dt[22][5]=0;
dt[22][6]=0;
dt[22][7]=0;
dt[23][5]=0;
dt[23][7]=0;
hj=0;
}
}
if(c=='c'){
system("cls");
while(1){
if(ss==1){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 新手稿子 ★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("_____");
cout<<endl;
printf (" L ");
cout<<endl;
printf (" ----|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 0$ 6=买 1个/次");
cout<<endl;
printf ("3=退出");
}
if(ss==2){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 普通稿子 ★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("____+");
cout<<endl;
printf (" L ");
cout<<endl;
printf (" +===|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 120$ 6=买 2个/次 ");
cout<<endl;
printf ("3=退出");
}
if(ss==3){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 中级稿子 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("=-__+");
cout<<endl;
printf (" R ");
cout<<endl;
printf (" +===|====|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 660$ 6=买 3个/次");
cout<<endl;
printf ("3=退出");
}
if(ss==4){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 高级稿子 ★★★ ");
cout<<"钱数"<<q;
cout<<endl;
printf ("=----+");
cout<<endl;
printf (" R ");
cout<<endl;
printf (" +===|EEEE|");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 990$ 6=买 4个/次 次页为最后一面");
cout<<endl;
printf ("3=退出");
}
c=getch();
if(c=='1'){
ss++;
}
if(c=='0'){
ss--;
}
if(ss==5){
ss=1;
}
if(ss==0){
ss=4;
}
if(c=='3'){
ss=1;
break;
}
if(ss==1&&c=='6'){
cj=1;
break;
}
if(ss==2&&c=='6'&&q>=20){
cj=2;
q-=120;
break;
}
if(ss==3&&c=='6'&&q>=30){
cj=3;
q-=660;
break;
}
if(ss==4&&c=='6'&&q>=40){
cj=4;
q-=990;
break;
}
}
}
if(c=='m'){
system("cls");
while(1){
if(ss==1){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 新手火箭 ★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 0$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==2){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 简易火箭 ★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 50$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==3){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 普通火箭 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf (" 150$ 6=买 ");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==4){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 开天号 ★★ ");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 250$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==5){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 开天号(升级版)★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
printf (" A ");
cout<<endl;
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" 300$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==6){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 银河号★★★");
cout<<"钱数"<<q;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" A ");
cout<<endl;
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 400$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==7){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 银河号(升级版)★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
printf (" AAA ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 550$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==8){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 宙斯号 ★★★★");
cout<<"钱数"<<q;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf ("H");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf ("A");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" 550$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==9){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 宙斯号(升级版) ★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" AAA ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" HHH ");
cout<<endl;
printf (" 600$ 6=买 ");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
if(ss==10){
system("cls");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" 创世神号 ★★★★★");
cout<<"钱数"<<q;
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
printf (" A ");
cout<<endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
printf (" H ");
cout<<endl;
printf (" H ");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED);
cout<<endl;
printf (" AAA ");
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" HHH ");
cout<<endl;
printf (" 900$ 6=买 次页为最后一面");
cout<<endl;
printf ("1下一个 0上一个");
cout<<endl;
printf ("警告:请在上一个火箭发射完之后再买此火箭");
cout<<endl;
printf ("3=退出");
}
c=getch();
if(c=='1'&&ss!=10){
ss++;
}else if(c=='1'&&ss==10){
ss=1;
}else if(c=='0'&&ss==1){
ss=10;
}else if(c=='0'&&ss!=1){
ss--;
}else if(c=='0'){
ss--;
}else if(c=='3'){
ss=1;
break;
}
if(c=='6'&&ss==1){
dt[23][6]=4;
dt[22][6]=5;
hj=1;
break;
}
if(c=='6'&&ss==2&&q>=50){
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=5;
dt[23][7]=5;
q-=50;
hj=2;
break;
}
if(c=='6'&&ss==3&&q>=150){
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=150;
hj=3;
break;
}
if(c=='6'&&ss==4&&q>=250){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=4;
dt[23][5]=5;
dt[23][7]=5;
q-=250;
hj=4;
break;
}
if(c=='6'&&ss==5&&q>=300){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=5;
dt[23][7]=5;
q-=300;
hj=5;
break;
}
if(c=='6'&&ss==6&&q>=400){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=400;
hj=6;
break;
}
if(c=='6'&&ss==7&&q>=550){
dt[21][6]=5;
dt[23][6]=4;
dt[22][6]=5;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=550;
hj=7;
break;
}
if(c=='6'&&ss==8&&q>=600){
dt[20][6]=5;
dt[21][6]=4;
dt[23][6]=4;
dt[22][6]=4;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=600;
hj=8;
break;
}
if(c=='6'&&ss==9&&q>=700){
dt[20][6]=5;
dt[21][6]=4;
dt[23][6]=4;
dt[22][6]=5;
dt[22][5]=5;
dt[22][7]=5;
dt[23][5]=4;
dt[23][7]=4;
q-=700;
hj=9;
break;
}
if(c=='6'&&ss==10&&q>=900){
dt[18][6]=5;
dt[19][6]=4;
dt[20][6]=4;
dt[21][6]=4;
dt[21][5]=5;
dt[21][7]=5;
dt[23][6]=4;
dt[22][6]=4;
dt[22][5]=4;
dt[22][7]=4;
dt[23][5]=4;
dt[23][7]=4;
q-=900;
hj=10;
break;
}
}
}
}
return 0;
}
初级光能
6
这是我的
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a,b,c,n,cnt;
void setpos(int x,int y){
HANDLE output=GetStdHandle(STD_OUTPUT_HANDLE);
COORD pos={x,y};
SetConsoleCursorPosition(output,pos);
}
void zhuanzhulixvnlian(){
int x=50,y=3;
setpos(x,y);
int d;
cout<<"消 失 的 数 字\n";
cout<<" \n";
cout<<" 玩法说明:请输入关卡序号数字,选择游戏难度等级,并按Enter键进入\n";
cout<<" \n";
cout<<" 每轮游戏随机出现一组数字,2秒消失,请依次输入该组数字,用空格键隔开,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" 难度等级: 1.第一关 2.第二关 3.第三关\n";
cout<<" \n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
exit(0);
}
}
while(true){
if(cnt>=5){
cnt=0;
system("cls");//清屏
if(n==10){
cout<<" 恭喜你,进入第二关\n";
n=20;
}else if(n==20){
cout<<" 恭喜你,进入第三关\n";
n=100;
}
Sleep(1000);//等待1s
system("cls");//清屏
}
srand(time(NULL));//函数初始化随机数种子
a=rand()%n+1;//生成随机数
b=rand()%n+1;//生成随机数
c=rand()%n+1;//生成随机数
cout<<" ";
cout<<" \n";
cout<<" ";
cout<<a<<" "<<b<<" "<<c<<"\n";
Sleep(2000);//等待2s
system("cls");//清屏
cout<<" ";
int a1,b1,c1;
cin>>a1>>b1>>c1;
if(a1==a&&b1==b&&c1==c){
char t;
cout<<" 恭喜你答对了!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt++;
cout<<" ";
cin>>t;
system("cls");//清屏
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
}else{
char t;
cout<<" 不对哦!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt=0;
cout<<" ";
cin>>t;
system("cls");//清屏
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
}
}
}
void kousuannenglixvnlian(){
int x=50,y=3;
setpos(x,y);
int d;
cout<<"口 算 天 天 练\n";
cout<<" \n";
cout<<" 玩法说明:请输入关卡序号数字,选择游戏难度等级,并按Enter键进入\n";
cout<<" \n";
cout<<" 随机出现一个算式,请口算并输入得数,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" 难度等级: 1.第一关(10以内加减法) 2.第二关(20以内加减法) 3.第三关(50以内加减法) 4.第四关(100以内加减法)\n";
cout<<" \n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=50;
}else if(d==4){
n=100;
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
cin>>d;
if(d==1){
n=10;
}else if(d==2){
n=20;
}else if(d==3){
n=100;
}else{
exit(0);
}
}
while(true){
if(cnt>=5){
cnt=0;
system("cls");//清屏
if(n==10){
cout<<" 恭喜你,进入第二关\n";
n=20;
}else if(n==20){
cout<<" 恭喜你,进入第三关\n";
n=50;
}else{
cout<<" 恭喜你,进入第四关\n";
n=100;
}
Sleep(1000);//等待1s
system("cls");//清屏
}
system("cls");//清屏
srand(time(NULL));//函数初始化随机数种子
int fh=rand()%2+1;
char ysfh;
a=rand()%n+1;//生成随机数
b=rand()%n+1;//生成随机数
if(a<b){
swap(a,b);
}
int correct_ans,input_ans;
if(fh==1){
ysfh='+';
correct_ans=a+b;
}else{
ysfh='-';
correct_ans=a-b;
}
cout<<" \n";
cout<<" \n";
cout<<" ";
cout<<a<<ysfh<<b<<"=";
cin>>input_ans;
cout<<"\n";
if(input_ans==correct_ans){
cnt++;
cout<<" 恭喜你答对了!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cout<<" \n";
char t;
cout<<" ";
cin>>t;
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
system("cls");//清屏
}else{
char t;
cout<<" 不对哦!(输入“g”按Enter键继续,输入除“g”以外任意字符退出)\n";
cnt=0;
cout<<" ";
cin>>t;
if(t!='g'){
cout<<" 欢迎下次再来";
exit(0);
}
system("cls");//清屏
}
}
}
int main(){
cout<<"\n";
cout<<"\n";
cout<<"\n";
int x=50,y=3;
setpos(x,y);
cout<<"专 注 力 训 练\n";
cout<<" \n";
cout<<" 特别说明:请您仔细阅提示语,并按要求输入数字或字母,否则将自动退出程序\n";
cout<<" \n";
cout<<" 选择模式:\n";
cout<<" \n";
cout<<" 输入数字“1”并按Enter键进入“消失的数字” 输入数字“2”并按Enter键进入“口算天天练”\n";
cout<<" \n";
cout<<" \n";
cout<<" \n";
cout<<" 模式说明:\n";
cout<<" \n";
cout<<" 1.消失的数字:\n";
cout<<" \n";
cout<<" 玩法:每轮游戏随机出现一组数字,2秒消失,请依次输入该组数字,用空格键隔开,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" \n";
cout<<" 2.口算天天练:\n";
cout<<" \n";
cout<<" 玩法:随机出现一个算式,请口算并输入得数,按Enter键提交\n";
cout<<" \n";
cout<<" 每轮游戏连续答对5题可自动升级,进入下一关\n";
cout<<" \n";
cout<<" \n";
int f;
cout<<" ";
cin>>f;
if(f==1){
system("cls");//清屏
zhuanzhulixvnlian();
}else if(f==2){
system("cls");//清屏
kousuannenglixvnlian();
}else{
cout<<" 输入错误,请重新输入序号(仅限数字)\n";
cout<<" ";
int f;
cin>>f;
if(f==1){
system("cls");//清屏
zhuanzhulixvnlian();
}else if(f==2){
system("cls");//清屏
kousuannenglixvnlian();
}else{
exit(0);
}
}
return 0;
}
/*
1.输入数字超时问题。
2.更换设计的背景图片。
3.连续答对5题自动升级难度,继续闯关问题。
4.输出训练须知
5.光标居中
*/
中级光能
#include<iostream>
#include<windows.h>
#include<cmath>
using namespace std;
long double sz1,sz2,jieguo;
char fuhao;
void jia(){
string message=to_string(sz1)+"+"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void jian(){
string message=to_string(sz1)+"-"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void cheng(){
string message=to_string(sz1)+"×"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void chu(){
string message=to_string(sz1)+"÷"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void mi(){
string message=to_string(sz1)+"^"+to_string(sz2)+"="+to_string(jieguo);
MessageBox(NULL,message.c_str(),"计算器",MB_OK);
}
void mann(){
MessageBox(NULL,"此计算器支持 + - × ÷ ^ (+ - * / ^)","计算器",MB_OK);
MessageBox(NULL,"此计算器会将等式数字与结果自动保留六位小数","计算器",MB_OK);
MessageBox(NULL,"请在控制台输入等式","计算器",MB_OK);
cin>>sz1>>fuhao>>sz2;
if(fuhao=='+'){
jieguo=sz1+sz2;
jia();
}
if(fuhao=='-'){
jieguo=sz1-sz2;
jian();
}
if(fuhao=='*'){
jieguo=sz1*sz2;
cheng();
}
if(fuhao=='/'){
jieguo=sz1/sz2;
chu();
}
if(fuhao=='^'){
jieguo=(long double)(pow(sz1,sz2));
mi();
}
system("cls");
MessageBox(NULL,"继续计算……","计算器",MB_OK);
mann();
}
int main() {
system("title 计算器");
mann();
return 0;
}
献丑了