Guest User

Untitled

a guest
Jan 12th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8. class Pojazd
  9. {
  10. public:
  11. string marka;
  12. string rodzaj;
  13. void jestem1()
  14. {
  15. cout<<"Jestem pojazdem"<<endl;
  16. }
  17. Pojazd();
  18. };
  19.  
  20. class Motocykl:public Pojazd
  21. {
  22. public:
  23. string typ;
  24. void jestem2()
  25. {
  26. cout<<"Jestem motocylkem"<<endl;
  27. }
  28. Motocykl();
  29. };
  30. class Samochod:public Pojazd
  31. {
  32. public:
  33. string moc;
  34. string typ;
  35. Samochod();
  36. void jestem3()
  37. {
  38. cout<<"Jestem samochodem"<<endl;
  39. }
  40. };
  41. class ciezarowy:public Samochod
  42. {
  43. public:
  44. string przyczepa;
  45. void jestem4()
  46. {
  47. cout<<"Jestem samochodem ciezarowym"<<endl;
  48. }
  49. ciezarowy();
  50. };
  51. class osobowy:public Samochod
  52. {
  53. public:
  54. int max_pasazerow;
  55. void jestem5()
  56. {
  57. cout<<"Jestem samochodem osobowym"<<endl;
  58. }
  59. osobowy();
  60. };
  61. class Lodz:public Pojazd
  62. {
  63. public:
  64. string komfort;
  65. void jestem6()
  66. {
  67. cout<<"Jestem lodzia"<<endl;
  68. }
  69. Lodz();
  70. };
  71. class Amfibia:public Lodz,osobowy
  72. {
  73. string wielkos_baku;
  74. void jestem7()
  75. {
  76. cout<<"Jestem amfibia"<<endl;
  77. }
  78. Amfibia();
  79. };
  80.  
  81.  
  82. int main()
  83. {
  84. cout<<"drzewo klas"<<endl;
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. }
Add Comment
Please, Sign In to add comment