#include<iostream>
#include<time.h>
#include<math.h>
using namespace std;
class Point
{
public:
int x;
int y;
void operator =(Point &p)
{x=p.x;y=p.y;}
void QuickSortx(Point a[],int low,int high);//快速排序
void QuickSorty(Point a[],int low,int high);//快速排序
double PointShortestDistance(Point x[],Point y[],int low,int high,Point &p1,Point &p2);
friend ostream &operator<<(ostream &output,Point &cc);
double distance(Point p1,Point p2)
{
int x=(p1.x-p2.x)*(p1.x-p2.x);
int y=(p1.y-p2.y)*(p1.y-p2.y);
return sqrt((double)(x+y));
}
private:
int splitx(Point a[],int low,int high);
int splity(Point a[],int low,int high);
};
int main()
{
Point p[10];//存放按x坐标升序的坐标
Point y[10];//存放按y坐标升序的已经按x坐标升序的坐标
(算法设计技巧与分析)CloseStpair
最新推荐文章于 2022-02-22 12:59:47 发布