永发信息网

vb找出所有3-5位数中的升序数

答案:2  悬赏:0  手机版
解决时间 2021-07-26 05:32
  • 提问者网友:謫仙
  • 2021-07-25 06:36

所谓升序数就是个位大于十位,十位大于百位的三位数 如 123

最佳答案
  • 五星知识达人网友:千杯敬自由
  • 2021-07-25 07:17

'是不是下面这个,看看


'加一个textbox,一个按钮


'textbox 的 text 为空, MultiLine 为 True


Private Sub Command1_Click()
Dim a, b, c As Integer
For a = 1 To 9
For b = a + 1 To 9
For c = b + 1 To 9
Text1.Text = Text1.Text & a & b & c & Space(1)
Next
Next
Next
End Sub

全部回答
  • 1楼网友:底特律间谍
  • 2021-07-25 08:48

求3-5位数的所有升序数的程序:

在窗体中添加一个按钮Command1,一个list列表框List1,则程序如下所示:

Private Sub Command1_Click() Dim n, sign As Integer, st, fi, j, num As Long Dim k As Integer, a() As Integer, i As Integer st = 10 ^ 2 fi = 10 ^ 5 - 1 For j = st To fi sign = 0 num = j k = Len(CStr(j)) ReDim a(k) As Integer For i = k To 1 Step -1 a(i) = num Mod 10 num = Int(num / 10) Next i For i = 1 To k - 1 If a(i) >= a(i + 1) Then Exit For Next i If i = k And a(k - 1) < a(k) Then sign = 1 If sign = 1 Then List1.AddItem j Next j End Sub

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯