为什么报错啊?有没有人来看看哪里错了,QQL
#include
#include
#include
#include
#include
#include
#define KEY_DOWN(VK_NONAME)((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
#include
#include
#include
using namespace std;
int main()
{
int a,b,ljkjd=1,kjkjd=1,infantry=5,tank=0,plane=0,month=1,jd=0;
int arr[3]={1,2,3};
cout<<" ■■■ ■ ■ ■"<" ■■ ■■■■"<" 二战 ■ ■"<" ■ ■ ■ ■ ■"<" ■■■■ ■ ■■ "<" 1.0版本 "<printf("按任意键开始\n");
getch();
system("cls");
//1941年介入战争
MessageBox(NULL,"步兵<坦克<飞机,步兵>飞机","注",MB_OK);
MessageBox(NULL,"准备?","苏军",MB_OK);
MessageBox(NULL,"开始!","苏军",MB_OK);
system("cls");
cout<<"1941年,德军正式向苏联宣战"<getch();
while(1){
cout<<"第"<"个月"<"你要:1.生产 2.出击 "<>a;
if(a==1){
while(1){
cout<<"你要生产(研制)什么?1.步兵(1陆军科技点1攻击) 2.坦克(2陆军科技点2攻击) 3.飞机(3空军科技点2攻击)";
cout<"注:研制不会消耗科技点。";
cin>>a;
if(a==1&&ljkjd>=1){
cout<<"成功!步兵lv+1"<printf("按任意键继续\n");
getch();
system("cls");month+=1;infantry+=1;break;
}
else{
cout<<"陆军科技点不足!"<printf("按任意键继续\n");
getch();
system("cls");continue;
}
if(a==2&&ljkjd>=2){
cout<<"成功!坦克lv+1"<printf("按任意键继续\n");
getch();
system("cls");month+=1;tank+=2;break;
}
else{
cout<<"陆军科技点不足!"<printf("按任意键继续\n");
getch();
system("cls");continue;
}
if(a==3&&kjkjd>=3){
cout<<"成功!飞机lv+1"<printf("按任意键继续\n");
getch();
system("cls");month+=1;plane+=2;break;
}
else{
cout<<"空军科技点不足!"<printf("按任意键继续\n");
getch();
system("cls");continue;
}
}
}
if(a==2){
int size=sizeof(arr)/sizeof(arr[0]);
while(1){
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, size - 1);
int randomIndex = dis(gen);
int enemy = arr[randomIndex];
if(infantry>enemy&&tank>enemy||battleplane>enemy){
cout>>"胜利! 获得:陆军科技点*3! 空军科技点*1!"<3;kjkjd+=1;month++;jd+=2;
printf("按任意键继续\n");
getch();
system("cls");break;arr[randomIndex]+=1;
}
else if(infantry=enemy&&tank=enemy||battleplane=enemy){
cout<<"平局!"<printf("按任意键继续\n");
getch();
system("cls");break;month++;jd+=1;arr[randomIndex]+=1;
}
else{
cout<<"失败!"<printf("按任意键继续\n");
getch();
system("cls");month++;
if(jd>1)
jd-=1;break;
jd=1;break;
}
}
}
if(jd==0&&month==12){
cout<<"德军直夺莫斯科"<<"--------结局1:灭亡--------";
printf("按任意键继续\n");
getch();
system("cls");
return 0;
}
if(jd==10){
cout<<"恭喜,首相,您带领苏维埃走向了胜利!"<"共用时:"<" 个月";
cout<<"再见,首相 您该休息会儿了"<" ★"<"--------结局2:胜利!-------"<"制作:徐梓煜";
return 0;
}
continue;
}
return 0;
}
所以,哪里错了啊!/( QAQ)/
