Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Point {
- public:
- int x;
- int Show_x ();
- public:
- int y;
- int Show_y ();
- };
- int Point::Show_x() {
- return x;};
- int Point::Show_y() {
- return y;};
- class circle {
- public:
- int get_x;
- int Show_x ();
- public:
- int get_y;
- int Show_y ();
- protected:
- int r;
- int show_r ();
- class cylinder {
- public:
- int get_x;
- int Show_x ();
- public:
- int get_y;
- int Show_y ();
- int get_r;
- int show_r ();
- protected:
- int h;
- int show_h ();
- void show();
- Cylinder (int x, int y, int r, int h) {
- }
- int main() {
- cylinder cylinder1(5, 6, 2, 10);
- cylinder cylinder2(2, 15, 15, 100);
- cylinder cylinder3(9, 90, 30, 105);
- cout << "Cylinder 1 : " << x << ", "
- << y << ", "
- << r << ", "
- << h << "\n\n";
- cout << "Cylinder 2 : " << x << ", "
- << y << ", "
- << r << ", "
- << h << "\n\n";
- cout << "Cylinder 3 : " << x << ", "
- << y << ", "
- << r << ", "
- << h << "\n\n";
- ;
- cout << "Cylinder 1: "; cylinder1.show_r();
- cout << "Cylinder 2: "; cylinder2.show_r();
- cout << "Cylinder 3: "; cylinder3.show_r();
- return 0;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment