首页 > TAG信息列表 > Petdogs

实验五

#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()&

实验五

#include<string>#include<iostream>using namespace std;class MachinePets {public: MachinePets(const string s); virtual string talk()=0; string getNickname() { return nickname; }private: string nickname;};class PetCats:publ

实验五

//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

实验五

#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