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:这样怎么还不对啊?总草时,谁能帮我解决一下?

Posted by gz2001 at 2003-07-08 11:20:30 on Problem 1002
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:
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