#include <stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
#define PI 3.1415926535
struct point
{
double x,y,s;
}m[101];
bool cmp(point a,point b){return a.s<b.s;}
int main(){
int n,i;
while(scanf("%d",&n) && n>=0){
for(i=1;i<=n;i++){
scanf("%lf%lf",&m[i].x,&m[i].y);
if(m[i].x==0)
m[i].s=PI/2;
else if(m[i].x<0)
m[i].s=atan(m[i].y/m[i].x)+PI;
else
m[i].s=atan(m[i].y/m[i].x);
}
sort(m+1,m+n+1,cmp);
for(i=1;i<n;i++)
printf("%.1lf %.1lf ",m[i].x,m[i].y);
if(n!=0)
printf("%.1lf %.1lf\n",m[i].x,m[i].y);
}
return 0;
}
hdu1785 You Are All Excellent
最新推荐文章于 2018-04-09 19:10:32 发布