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:假如两个原来sort一样的时候按照原来的顺序排输出 ??你的没有

Posted by code_snail at 2010-07-25 09:10:46 on Problem 1007
In Reply To:看看有什么不同的地方,我的过了, Posted by:lj__1030 at 2010-07-14 11:45:29
typedef struct code{
        int num;
        int H;
        bool operator < (const code & a)const{
             if(a.num<num)return 0;
             else if(a.num>num) return 1;
             else if(a.H<H)return 0;
             else return 1;
             }
};
这是我的结构体
在里面重载 < 号 然后
sort()
就行了

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