我编植物大战僵尸1-1,前面一直输出不了,怎么办?
#include
#include
using namespace std;
#define ll long long
#define db double
#define str string
#define endl '\n'
#define PII pair
#define ull unsigned long long
#define t int
#define sh short
#define lg long
#define fl float
#define ch char
#define b bool
#define ct const
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
sh h=1;
str wdss = "豌豆射手";
str vis[2][10];
t x, y;
ll shine = 150;
b victory;
int main() {
IOS;
memset(vis, '*', sizeof vis);
for (int i = 1; i <= 5; i++) {
cout << "第" << i << "次操作,你要种什么?\n";
cout << "1." << wdss << endl;
cin >> x >> y;
shine += 50;
shine -= 100;
vis[x][y] = wdss;
cout << shine;
for (t j = 1; j <= 9; j++) {
cout << vis[1][j];
}
}
return 0;
}
c++编写植物大战僵尸#include #include #include using namespace std;//植物类class Plant {public: Plant(string name, int hp, int attack) : name_(name), hp_(hp), attack_(attack) {} string getName() { return name_; } int getHp() { return hp_; } int getAttack() { return attack_; } void setHp(int hp) { hp_ = hp; } void attack(Plant &target) { target.setHp(target.getHp() - attack_); }private: string name_; int hp_; int attack_;};//僵尸类class Zombie {public: Zombie(string name, int hp, int attack) : name_(name), hp_(hp), attack_(attack) {} string getName() { return name_; } int getHp() { return hp_; } int getAttack() { return attack_; } void setHp(int hp) { hp_ = hp; } void attack(Plant &target) { target.setHp(target.getHp() - attack_); }private: string name_; int hp_; int attack_;}; //游戏类,控制游戏的进行,植物和僵尸的交互等等。 class Game { public: Game() {} void addPlant(Plant plant) { plants_.push_back(plant); } void addZombie(Zombie zombie) { zombies_.push_back(zombie); } void start() { while (tru
不知道你这个问题是否已经解决, 如果还没有解决的话: