Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:终于知道了,是qsort函数的compare写错了。

Posted by jackrhctest at 2009-05-21 14:03:37 on Problem 1468
In Reply To:终于知道了,是qsort函数的compare写错了。 Posted by:piaolingqingsi at 2008-04-05 15:09:10
> 把cmp改成这样就过了。
> 
> int cmp(const void* a, const void* b){
> 	
> 	struct rect *c = (struct rect *)a;
> 	struct rect *d = (struct rect *)b;
> 	if(c->x1 != d->x1) return (d->x1)-(c->x1);
> 	else if( c->x2 != d->x2 ) return (c->x2)-(d->x2);
> 	else if( c->y1 != d->y1 ) return (d->y1)-(c->y1);
> 	else  return (c->y2)-(d->y2);
> )

顶一个,开始没注意到

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator