标签:int ret str logs sort amp blog har main
sort int
bool cmp(int a,int b) { return a>b; } int main() { int a[100]; sort(a,a+100,cmp); }
sort struct
struct T { int x,y; }nod[100]; bool cmp(T a,T b)//先按x从小到大排,相同,再按y从小到大 { return a.x<b.x||(a.x==b.x&&a.y<b.y); } sort(nod,nod+n,cmp);//n是长度
标签:int ret str logs sort amp blog har main
原文地址:http://www.cnblogs.com/ljhacm/p/6677829.html