首页 > TAG信息列表 > PetCats

实验五

1 2 3 #include<iostream>#include<string>#include<cstdlib>using namespace std;class MachinePets{public: MachinePets(const string s); virtual string talk() const=0; string getNickname(); virtual ~MachinePets(); private:

实验五

#include <iostream>#include<string>#include"MachinePets.h"#include "PetCats.h"#include "PetDogs.h"using namespace std;void play(MachinePets *p){ cout<<p->getNickname()<<" says "<<p-

实验5

一 机械宠物 #include <iostream>#include "MachinePets.h"#include "Petcats.h"#include "Petdogs.h"using namespace std;void play(MachinePets *m){ cout<<m->getnickname()<<" say "<<m->talk()&

实验五

//MachinePets.h#include<iostream>#include<string>using namespace std;#ifndef MACHINEPETS_H#define MACHINEPETS_Hclass MachinePets{public: MachinePets(const string s); virtual string talk() const=0; string getNickname();private: stri

实验五

1 main.cpp #include <iostream>#include <string>using namespace std;#include "MachinePets.h"#include "PetCats.h"#include "PetDogs.h"void play(MachinePets *x){ cout<<x->getNickname()<<"says&qu

实验五

#ifndef MACHINEPETS_H#define MACHINEPETS_H#include <iostream>#include <string>using namespace std;class MachinePets{ public: MachinePets(const string s); string getNickname(); virtual string talk()=0; priva