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

被阴了~~~~~~~~~排序时注意一下

Posted by langx at 2010-10-11 20:01:38 on Problem 2021
被阴了~~~~~~~~~排序时注意一下
我是用sort的~~~~~~~~~~

bool compare(Person &a, Person &b){
	if(a.age == b.age)
		return strcmp(a.name,b.name) >= 0 ? true : false;//这里注意
	return a.age < b.age;
}

输出倒过来输出~~~~~~~~~~


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