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:WA的可以进来看看~~In Reply To:WA的可以进来看看~~ Posted by:lsw20083820 at 2009-08-12 10:32:34 int cmp(const void *a,const void *b) { struct IN*c=(IN*)a; struct IN*d=(IN*)b; return c->left - d->left > 0 ? 1 : -1 ;//AC return c->left - d->left;//WA } 当数据类型是duoble的时候qsort在排序两个非常接近的值时,上面两个return返回值可能不同,导致排序结果不一定正确。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator