Advertisement
erzis

Untitled

Dec 14th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Rectangle {
  4. int width, height;
  5. public:
  6. void count_area(int, int);
  7. int area()
  8. {
  9. return width*height;
  10. }
  11. };
  12.  
  13. void Rectangle::count_area(int x, int y)
  14. {
  15. width = x;
  16. height = y;
  17. }
  18.  
  19. int main() {
  20. Rectangle rect;
  21. rect.count_area(5, 3);
  22. std::cout << rect.area() << std::endl;
  23.  
  24. system("pause");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement