point.h
Upload User: puke2000
Upload Date: 2022-07-25
Package Size: 912k
Code Size: 1k
Category:

CSharp

Development Platform:

Visual C++

  1. //=====================================
  2. // point.h
  3. //=====================================
  4. #ifndef HEADER_POINT
  5. #define HEADER_POINT
  6. #include<iostream>
  7. using namespace std;
  8. //-------------------------------------
  9. class Point{
  10.   int x, y;
  11. public:
  12.   void set(int a, int b);
  13.   Point operator+(const Point& d);
  14.   friend ostream& operator<<(ostream& o, const Point& d);
  15. };//===================================
  16. inline ostream& operator<<(ostream& o, const Point& d){
  17.   return o<<'('<<d.x<<','<<d.y<<')'<<'n';
  18. }//------------------------------------
  19. #endif  // HEADER_POINT
  20.