| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:终于知道了,是qsort函数的compare写错了。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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator