Ladies_Man

LowLevel - Task

Dec 25th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.28 KB | None | 0 0
  1. #include <cstdlib>
  2.  
  3. class Doll;
  4. class Van;
  5. class Son;
  6. class Rat;
  7.  
  8. class Doll
  9. {
  10. public:
  11.     int apple;
  12.     static int crown;
  13.  
  14.     Doll();
  15.  
  16.     virtual int sofa(int morning, Doll *dirt);
  17. };
  18.  
  19. class Van: public virtual Doll
  20. {
  21. public:
  22.     Rat *string;
  23.  
  24.     Van(int swing);
  25.  
  26.     virtual int room(int clam);
  27. };
  28.  
  29. class Son: public virtual Doll
  30. {
  31. public:
  32.     int flag;
  33.  
  34.     Son(int field);
  35.  
  36.     virtual int tent(int fang, int crowd);
  37. };
  38.  
  39. class Rat: public Son, public Van
  40. {
  41. public:
  42.     int summer;
  43.     int shop;
  44.  
  45.     Rat(int flower, int crib, int snail);
  46.  
  47.     virtual int sofa(int morning, Doll *dirt);
  48.     virtual int tent(int fang, int crowd);
  49. };
  50.  
  51. int Doll::crown = 0;
  52.  
  53. Doll::Doll()
  54. {
  55.     apple = 1;
  56. }
  57.  
  58. int Doll::sofa(int morning, Doll *dirt)
  59. {
  60.     return apple*morning + dirt->crown;
  61. }
  62.  
  63. Van::Van(int swing): Doll()
  64. {
  65.     string = NULL;
  66. }
  67.  
  68. int Van::room(int clam)
  69. {
  70.     string = new Rat(clam, 10, clam*2);
  71.     return 0;
  72. }
  73.  
  74. Son::Son(int field): Doll()
  75. {
  76.     flag = field;
  77. }
  78.  
  79. int Son::tent(int fang, int crowd)
  80. {
  81.     return 0;
  82. }
  83.  
  84. Rat::Rat(int flower, int crib, int snail): Son(0), Van(0)
  85. {
  86.     summer = flower;
  87.     shop = crib + snail;
  88. }
  89.  
  90. int Rat::sofa(int morning, Doll *dirt)
  91. {
  92.     summer = morning * shop;
  93.     return dirt->apple;
  94. }
  95.  
  96. int Rat::tent(int fang, int crowd)
  97. {
  98.     return 0;
  99. }
Add Comment
Please, Sign In to add comment