#include<iostream> #include<string.h> #include<math.h> #include<algorithm> using namespace std; #define MAX 10010 struct node { double x,y; }point[MAX]; bool cmp(node a,node b) { if(a.x*b.y-a.y*b.x>0) return true; return false; } int main() { int n=0; while(scanf("%lf%lf",&point[n].x,&point[n].y)!=EOF) { n++; } sort(point+1,point+n,cmp); for(int i=0;i<n;i++) cout<<"("<<point[i].x<<","<<point[i].y<<")"<<endl; return 0; } /* F:\temp\16139835.54852\Main.cc: In function 'int main()': F:\temp\16139835.54852\Main.cc:21: error: 'scanf' was not declared in this scope F:\temp\16139835.54852\Main.cc:21: error: 'EOF' was not declared in this scope */ |
Double click to view unformatted code.