⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 point.h

📁 常用算法与数据结构原代码
💻 H
字号:
#ifndef Point_
#define Point_

class Point2;

class  Point1 
{
	friend float dist(const Point1&, const Point1&);
	friend void close(Point1 *, Point2 *, Point2 *,
		int, int, Point1&, Point1&, float&);
	friend bool closest(Point1 *, int, Point1&, Point1&,float&);
	friend void main();
public:
	int operator<=(Point1 a) const
	{
		return (x <= a.x);
	}
private:
	int ID;      // point identifier
	float x, y;  // point coordinates
};

class  Point2 
{
	friend float dist(const Point2&, const Point2&);
	friend void close(Point1 *, Point2 *, Point2 *,
		int, int, Point1&, Point1&, float&);
	friend bool closest(Point1 *, int, Point1&, Point1&, float&);
	friend void main();
public:
	int operator<=(Point2 a) const
	{
		return (y <= a.y);
	}
private:
	int p;       // index to same point in array X
	float x, y;  // point coordinates
};

#endif

⌨️ 快捷键说明

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