永发信息网

VB输任意1个不超过9位的正整数,求该整数的全部数字组成的同样位数最大正整数、最小数 结果放text

答案:2  悬赏:0  手机版
解决时间 2021-02-21 02:55
  • 提问者网友:沉默菋噵
  • 2021-02-20 15:14
VB输任意1个不超过9位的正整数,求该整数的全部数字组成的同样位数最大正整数、最小数 结果放text
最佳答案
  • 五星知识达人网友:佘樂
  • 2021-02-20 15:44
Private Sub Command1_Click()Dim a() As IntegerDim i As IntegerDim j As IntegerDim k As IntegerDim n As IntegerDim s As StringDim max As StringDim min As Strings = Text1n = Len(s)ReDim a(1 To n) As IntegerFor i = 1 To na(i) = Val(Mid(s,i,1))Next iFor i = 1 To nFor j = 1 To n - iIf a(j) k = a(j)a(j) = a(j + 1)a(j + 1) = kEnd IfNext jNext iFor i = 1 To nmax = max & a(i)min = a(i) & minNext iText2 = maxText3 = minEnd Sub
全部回答
  • 1楼网友:轻熟杀无赦
  • 2021-02-20 16:11
我好好复习下
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯