Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Zwierze{
- protected:
- int v;
- string odglos;
- public:
- Zwierze(string odglos){
- this->odglos=odglos;
- }
- void dajGlos(){
- cout<<odglos<<endl;
- }
- virtual void setOdglos(string odglos)=0;
- };
- namespace landAnimal{
- class Zwierze_ladowe:virtual public Zwierze{
- protected:
- int liczba_nog;
- public:
- Zwierze_ladowe(string a):Zwierze(a){
- odglos=a;
- }
- void setNogi(int liczba_nog){
- this->liczba_nog=liczba_nog;
- }
- };
- }
- namespace dog{
- class Pies:public landAnimal::Zwierze_ladowe{
- public:
- Pies(string b):landAnimal::Zwierze_ladowe(b),Zwierze(b){
- }
- void setOdglos(string odglos){
- this->odglos=odglos;
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement