Guest User

Untitled

a guest
Dec 11th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <clocale>
  4. #include <string>
  5. #include <clocale>
  6. using namespace std;
  7.  
  8. class dog {
  9. friend class person;
  10. private:
  11. int health = 100;
  12. };
  13. class person {
  14. public:
  15. void damage(dog d) {
  16. d.health -= 20;
  17. }
  18. };
  19. int main(int argc, const char * argv[]) {
  20. person vasya;
  21. dog bobik;
  22. cout << vasya.damage(bobik);
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment