point.hpp 415 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef POINT_HPP
  2. #define POINT_HPP
  3. #include <iostream>
  4. using namespace std;
  5. class Point{
  6. public:
  7. double x;
  8. double y;
  9. Point();
  10. Point(double x,double y);
  11. };
  12. ostream& operator<<(ostream& os,const Point& P);
  13. inline
  14. Point::Point():x(0),y(0){
  15. }
  16. inline
  17. Point::Point(double _x,double _y):x(_x),y(_y){
  18. }
  19. inline ostream&
  20. operator<<(ostream& os,const Point& P){
  21. return os<<'('<<P.x<<','<<P.y<<')';
  22. }
  23. #endif