Skip to content

Instantly share code, notes, and snippets.

@FernandoZhuang
Created January 8, 2019 03:35
Show Gist options
  • Save FernandoZhuang/ac4308ba2b4e6c3e7acd0461b4d2f4c2 to your computer and use it in GitHub Desktop.
Save FernandoZhuang/ac4308ba2b4e6c3e7acd0461b4d2f4c2 to your computer and use it in GitHub Desktop.
Powerful Cmp:字符串拼接,构成最小的数
#include <algorithm>
bool Cmp(string A, string B){
return A+B<B+A;
}
int main(){
……
sort(str,str+len,Cmp);
……
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment