public int DescendingOrder(int num)
{
var inpNum = num;
List<int> list = new List<int>();
while (inpNum > 0)
{
list.Add(inpNum % 10);
inpNum = inpNum / 10;
}
list.Sort();
string[] array = list.Select(n => n.ToString()).ToArray();
var result = string.Join(null, array);
return Convert.ToInt32(result);
}
string str = "1243586701";
Console.WriteLine(String.Concat(str.OrderBy(x => x)));