C++ Solution
```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        if(num<0){\n            num=num(-1);\n            string s=to_string(num)
```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        if(num<0){\n            num=num*(-1);\n            string s=to_string(num);\n            sort(s.begin(),s.end(),greater<int>());\n            stringstream g(s);\n            long long  k=0;\n            g>>k;\n            return ((-1)*k);\n        }\n        string s=to_string(num);\n        sort(s.begin(),s.end());\n        if(s[0]==\'0\'){\n            int j=1;\n            while(s[j]==\'0\'){\n                j++;\n            }\n            swap(s[0],s[j]);\n        }\n        stringstream g(s);\n        long long k=0;\n        g>>k;\n        return (k);\n        \n    }\n};
['C']