'在 text1 中已经输入 213,text2 即出现 321
Dim n As Integer, max As Integer
Dim a As Integer, b As Integer, c As Integer, t As Integer
x = Val(Text1.Text) ' ①
a = x \ 100
b = x \ 10 Mod 10
c = x Mod 10
If a < b Then t = a: a = b: b = t
If a < c Then t = a: a = c: c = t
If b < c Then t = c: c = b: b = t
max = a * 100 + b * 10 + c
Text2.Text = Str(max)
很简单的问题,只是你排版有点乱。