Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- class Car
- {
- public:
- void Drive()
- {
- std::cout << "Я еду" << std::endl;
- }
- };
- class Airplane
- {
- public:
- void Fly()
- {
- std::cout << "Я лечу" << std::endl;
- }
- };
- //множественное наследование
- class FlyingCar : public Car, public Airplane{};
- int main(int argc, char *argv[])
- {
- setlocale(LC_ALL, "Rus");
- srand(time(NULL));
- FlyingCar car;
- car.Drive();
- car.Fly();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement