摘要: 1 bool cmp(const str &x,const str &y)2 {3 if(x.a1==y.a1)4 return x.a2<y.a2;5 return x.a1<y.a1;6 }sort 真心不会用啊 这个cmp搞得我各种头痛.... 上面代码 是两个关键字的sort a1为第一关键字 a2为第二关键字 都是升序...以后 写多关键字 就这样写了.. ..升序 就用< 降序就> 还是比较容易记住的.... 1 bool cmp(const str &x,const str &y)2 {3 if(x.a1==y.a1 &am 阅读全文