标签:
1 class Solution { 2 public: 3 string PrintMinNumber(vector<int> nums){ 4 string res; //返回值 5 sort(nums.begin(),nums.end(),[](const int &m, const int &n){return to_string(m) + to_string(n) < to_string(n) + to_string(m); } ); 6 for(int i=0; i<nums.size();++i){ 7 res += to_string(nums[i]); 8 } 9 if(res[0] == ‘0‘) return "0"; 10 return res; 11 } 12 };
标签:
原文地址:http://www.cnblogs.com/wanderingzj/p/5358125.html