Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Roslina
- {
- public:
- virtual string imie (string) = 0;
- virtual string kolor (string) = 0;
- static int nr (int) = 0;
- virtual int kolce (void) = 0;
- };
- class Tulipan :public Roslina
- {
- public:
- string imie(string)
- string kolor(string)
- int Roslina::nr
- int kolce(void) {cout<<"mam 432 kolce"<<endl;}
- };
- class Roza :public Roslina
- {
- public:
- string imie(string)
- string kolor(string)
- int Roslina::nr
- int kolce(void) {cout<<"mam 854 kolce"<<endl;}
- };
- int main()
- {
- Tulipan tu;
- tu.imie(bazyl);
- cout<<imie()<<endl;
- tu.kolor(bialy)
- cout<<kolor()<<endl;
- Roslina::nr++
- Roza ro;
- ro.imie(hiacenta);
- cout<<imie()<<endl;
- tu.kolor(bialy)
- cout<<kolor()<<endl;
- Roslina *wsk;
- wsk = new Roza;
- wsk = new Tulipan;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement