Created
January 8, 2019 03:35
-
-
Save FernandoZhuang/ac4308ba2b4e6c3e7acd0461b4d2f4c2 to your computer and use it in GitHub Desktop.
Powerful Cmp:字符串拼接,构成最小的数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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