| ||||||||||
| 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:这样怎么还不对啊?总草时,谁能帮我解决一下?In Reply To:这样怎么还不对啊?总草时,谁能帮我解决一下? Posted by:yuenyun at 2003-07-08 10:14:14 用系统函数qsort应该可以过的
#include <stdlib.h>
...............
int cmp(const void *t1,const void *t2)
{int *a,*b;
a=(int *)t1; b=(int *)t2;
if (*a>*b) return 1;
if (*a<*b) return -1;
return 0;
}
qsort(a,N,sizeof(int),cmp)
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator