[C++] Sort
\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        string s = to_string(num);\n        if(num==0) return num;\n        if(num<0
```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        string s = to_string(num);\n        if(num==0) return num;\n        if(num<0){\n            sort(s.begin(), s.end(), greater<char>());\n            return -stoll(s);\n        }\n        sort(s.begin(), s.end());\n        if(s[0]==\'0\'){\n            for(int i=0; i<s.length(); i++){\n                if(s[i]!=\'0\'){\n                    swap(s[i], s[0]);\n                    break;\n                }\n            }\n        }\n        return stoll(s);\n    }\n};\n```
['C']