这道题就是极角排序
判断叉积与0的大小关系
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
using namespace std;
const int INF=0x3f3f3f3f;
#define mem(x,y) memset(x,y,sizeof(x))
#define SI(x) scanf("%d",&x);
struct Node
{
int x,y;
friend bool operator < (Node a,Node b)
{
if(a.y*b.x<b.y*a.x)return true;
else return false;
}
} dt[100010];
int main()
{
int k=0;
while(~scanf("%d%d",&dt[k].x,&dt[k].y))k++;
sort(dt+1,dt+k);//斜率从小到大排列
for(int i=0; i<k; i++)printf("(%d,%d)\n",dt[i].x,dt[i].y);
return 0;
}