Advertisement
Jopa322

Untitled

Oct 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. using namespace std;
  4.  
  5. class Ring
  6. {
  7. public:
  8. Ring(int outer=10, int inner=8);
  9. void vvod();
  10. void vivod();
  11. private:
  12. int Inner, Outer;
  13. };
  14.  
  15. Ring::Ring(int outer,int inner)
  16. {
  17. Outer = outer;
  18. Inner = inner;
  19. }
  20. void Ring::vvod()
  21. {
  22. cout << "vneshnee ";
  23. cin >> Outer;
  24. cout << "vnutrenee ";
  25. cin >> Inner;
  26. }
  27. void Ring::vivod()
  28. {
  29. cout << "vneshnee " << Outer << endl;
  30. cout << "vnutrennee " << Inner << endl << endl;
  31.  
  32. }
  33.  
  34.  
  35. void main()
  36. {
  37. Ring ring;
  38. Ring *ring2 = new Ring();
  39.  
  40. ring.vivod();
  41.  
  42. ring2->vvod();
  43. ring2->vivod();
  44. system("pause");
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement