const string Name[5] = {"dragon", "ninja", "iceman", "lion", "wolf"}; const int ROrder[5] = {2, 3, 4, 1, 0}; const int BOrder[5] = {3, 0, 1, 2, 4}; class Warrior { private: int no; // 编号 int strength; // 生命值 int attack; // 攻击力 int kind; // 种...
慕课c++大作业魔兽世界 #include<iostream>#include<string>#include<vector>#include<cstring>#include<cstdio>#include<cstdlib>using namespace std;//一些常用函数class Factory{public:staticvoidPrintVector(constvector<int>&l){autoi=l.begin();for(i=l.begin();i!=l.end();i++){cout<<*i<<endl;}...
}voidwork(inttime){printf("%03d %s ", time, camp.c_str());if(money < mincost) { runout =1;puts("headquarter stops making warriors"); }else{for(inti = pointer; i <5+ pointer; i++) {intt = order[type][i %5];if(cost[t] <= money) { money -= cost[t]; amount++; cnt...
013 魔兽世界之一:备战 #include <iostream>#include <string>usingnamespacestd;staticintn;staticint*sumBloodArr;staticint(*manBloodArr)[5];conststringmanName[5]={"dragon","ninja","iceman","lion","wolf"};classRed{public:intredNo=0;intmanCount[5]={0,0,0,0,0};intmanBlood[5]={2,3,4...