point.h

来自「it is a usefull thing」· C头文件 代码 · 共 21 行

H
21
字号
//=====================================
// point.h
//=====================================
#ifndef HEADER_POINT
#define HEADER_POINT
#include<iostream>
using namespace std;
//-------------------------------------
class Point{
  int x, y;
public:
  void set(int a, int b);
  Point operator+(const Point& d);
  friend ostream& operator<<(ostream& o, const Point& d);
};//===================================
inline ostream& operator<<(ostream& o, const Point& d){
  return o<<'('<<d.x<<','<<d.y<<')'<<'\n';
}//------------------------------------
#endif  // HEADER_POINT

 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?