bool cmp2(const Point &a,const Point &b)//极角升序 { if( xmult(a,b,p0) <0 ) returnfalse; elsereturntrue; }
int main() { int n =0,i; //freopen("2007.txt","r",stdin); while( scanf("%lf %lf",&p[n].x,&p[n].y) != EOF ) { n ++; } sort(p+1,p+n,cmp1);
sort(p+1,p+n,cmp2);
int top =-1,S[MAXN]; S[++top] =0; S[++top] =1; for( i =2 ; i < n ; i ++ )//grahamScan扫描法 { while( xmult(p[i],p[S[top]],p[S[top-1]]) >0 ) top --; S[++top] = i; } for( i =0 ; i <= top ; i ++ ) printf("(%.lf,%.lf)\n",p[i].x,p[i].y); return0; }