#include <iostream>
#include <string>
#include <random>
#include <Windows.h>
using namespace std;
int playerHP = 20;
int enemyHP = 20;
int playerAtk =(rand()%4 + 5); //Find a random number between 5 and 8
int playerDef = (rand()%4 + 5);
int playerAgi = (rand()%4 + 5);
int enemyAtk = (rand()%4 + 4); //Find a random number between 5 and 7
int enemyDef = (rand()%4 + 4);
int enemyAgi = (rand()%4 + 4);
cout<<"---------------"<< endl; // what in the sam hill is going on
cout<<"FIGHTER STATS"<< endl;
cout<<"----------------"<<endl;
cout<<"Player Stats:"<<endl;
cout<<"HP "<<playerHP<<endl;
cout<<"ATK "<<playerAtk<<endl;
cout<<"DEF "<<playerDef<<endl;
cout<<"AGI "<<playerAgi<<endl;
cout<<"ENEMY STATS:"<<endl;
cout<< "HP "<<enemyHP<<endl;
cout<<"ATK "<<enemyAtk<<endl;
cout<<"DEF "<<enemyDef<<endl;
cout<<"AGI "<<enemyAgi<<endl;
我似乎无法弄清楚为什么我的 cout 语句会在我的程序中产生如此多的错误。这显然不是我的全部程序,但我想让事情变得简短而甜蜜。我收到错误 C2143:syntax eerror: missing ';' 在 '<<' 之前,C4430:缺少类型说明符-int 假定,以及 C2086 'int cout':在我的几乎所有 cout 语句上重新定义,我不知道为什么。感谢您提供的所有帮助,请尽可能地简化操作,这是我的第一个 C++ 程序。