Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- class Pojazd
- {
- public:
- string marka;
- string rodzaj;
- void jestem1()
- {
- cout<<"Jestem pojazdem"<<endl;
- }
- Pojazd();
- };
- class Motocykl:public Pojazd
- {
- public:
- string typ;
- void jestem2()
- {
- cout<<"Jestem motocylkem"<<endl;
- }
- Motocykl();
- };
- class Samochod:public Pojazd
- {
- public:
- string moc;
- string typ;
- Samochod();
- void jestem3()
- {
- cout<<"Jestem samochodem"<<endl;
- }
- };
- class ciezarowy:public Samochod
- {
- public:
- string przyczepa;
- void jestem4()
- {
- cout<<"Jestem samochodem ciezarowym"<<endl;
- }
- ciezarowy();
- };
- class osobowy:public Samochod
- {
- public:
- int max_pasazerow;
- void jestem5()
- {
- cout<<"Jestem samochodem osobowym"<<endl;
- }
- osobowy();
- };
- class Lodz:public Pojazd
- {
- public:
- string komfort;
- void jestem6()
- {
- cout<<"Jestem lodzia"<<endl;
- }
- Lodz();
- };
- class Amfibia:public Lodz,osobowy
- {
- string wielkos_baku;
- void jestem7()
- {
- cout<<"Jestem amfibia"<<endl;
- }
- Amfibia();
- };
- int main()
- {
- cout<<"drzewo klas"<<endl;
- }
Add Comment
Please, Sign In to add comment