dontcare_hi

Untitled

Jan 27th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Point{
  4. public:
  5. int x,y;
  6. };
  7. class Circle : public Point{
  8. protected:
  9. int r;
  10.  
  11. };
  12. class Cylinder : public Circle{
  13. protected:
  14. int h;
  15.  
  16. public:
  17. void show(){
  18. std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
  19. std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
  20. std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
  21. }
  22.  
  23.  
  24. Cylinder(int x,int y, int r, int h){
  25. int get_x, get_y, get_r;
  26. }
  27.  
  28. };
  29. int main(){
  30. Cylinder obj1(2, 3, 4, 5);
  31. Cylinder obj2(90, 9, 5, 32);
  32. Cylinder obj3(6, 8, 3, 10);
  33.  
  34. obj1.show();
  35. obj2.show();
  36. obj3.show();
  37.  
  38. return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment