Sub aaa()
n = CLng(InputBox("Введите натуральне число"))
ReDim d(1 To 10)
i = 0
Do While n > 0
i = i + 1
d(i) = n Mod 10
n = n \ 10
Loop
ReDim Preserve d(1 To i)
n = i
For i = 1 To n - 1
For j = i + 1 To n
If d(i) < d(j) Then
t = d(i)
d(i) = d(j)
d(j) = t
End If
Next j
Next i
s = ""
For i = 1 To n
s = s + CStr(d(i))
Next i
MsgBox s
End Sub