Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct point{
- double x, y;
- point(double _x=0, double _y=0){
- x = _x;
- y = _y;
- }
- void read(){
- scanf("%lf %lf", &x, &y);
- }
- point operator +(point q){ return point(x+q.x, y+q.y); }
- point operator -(point q){ return point(x-q.x, y-q.y); }
- point operator *(double t){ return point(x*t, y*t); }
- point operator /(double t){ return point(x/t, y/t); }
- friend ostream& operator <<(ostream& o, point p) {
- return o << "(" << p.x << ", " << p.y << ")";
- }
- };
Add Comment
Please, Sign In to add comment