Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Roslina
  6. {
  7. public:
  8. virtual string imie (string) = 0;
  9. virtual string kolor (string) = 0;
  10. static int nr (int) = 0;
  11. virtual int kolce (void) = 0;
  12.  
  13. };
  14.  
  15. class Tulipan :public Roslina
  16. {
  17. public:
  18. string imie(string)
  19. string kolor(string)
  20. int Roslina::nr
  21. int kolce(void) {cout<<"mam 432 kolce"<<endl;}
  22. };
  23.  
  24. class Roza :public Roslina
  25. {
  26. public:
  27. string imie(string)
  28. string kolor(string)
  29. int Roslina::nr
  30. int kolce(void) {cout<<"mam 854 kolce"<<endl;}
  31. };
  32.  
  33. int main()
  34. {
  35. Tulipan tu;
  36. tu.imie(bazyl);
  37. cout<<imie()<<endl;
  38. tu.kolor(bialy)
  39. cout<<kolor()<<endl;
  40. Roslina::nr++
  41.  
  42. Roza ro;
  43. ro.imie(hiacenta);
  44. cout<<imie()<<endl;
  45. tu.kolor(bialy)
  46. cout<<kolor()<<endl;
  47.  
  48.  
  49. Roslina *wsk;
  50. wsk = new Roza;
  51.  
  52. wsk = new Tulipan;
  53.  
  54.  
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement