对十五个数进行变换

  1.  

    打开VB软件
  2. 在左侧工具箱中找到command的图标,在窗体中适当位置创建图标,在右侧属性窗口中caption后边改为“交换”。

  3. 双击窗体中command图标,在弹出的对话框中输入下列编码:

  4.  

    Cls
  5. me.font.size=50
  6. Dim a As Integer

  7. Dim b As Integer

  8. Dim c As Integer

  9. Dim d As Integer

  10. Dim e As Integer

  11. Dim f As Integer

  12. Dim g As Integer

  13. Dim h As Integer

  14. Dim i As Integer

  15. Dim j As Integer

  16. Dim k As Integer

  17. Dim l As Integer

  18. Dim m As Integer

  19. Dim n As Integer

  20. Dim o As Integer

  21. Dim swab AsInteger

  22. a = Int(Rnd *1000)

  23. b = Int(Rnd *1000)

  24. c = Int(Rnd *1000)

  25. d = Int(Rnd *1000)

  26. e = Int(Rnd *1000)

  27. f = Int(Rnd *1000)

  28. g = Int(Rnd *1000)

  29. h = Int(Rnd *1000)

  30. i = Int(Rnd *1000)

  31. j = Int(Rnd *1000)

  32. k = Int(Rnd *1000)

  33. l = Int(Rnd *1000)

  34. m = Int(Rnd *1000)

  35. n = Int(Rnd *1000)

  36. o = Int(Rnd *1000)

  37. If a < b Then

  38. Call swap(a, b)

  39. End If

  40. If b < c Then

  41. Call swap(b, c)

  42. End If

  43. If c < d Then

  44. Call swap(c, d)

  45. End If

  46. If d < e Then

  47. Call swap(d, e)

  48. End If

  49. If e < f Then

  50. Call swap(e, f)

  51. End If

if < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

If j < k Then

Call swap(j, k)

End If

If k < l Then

Call swap(k, l)

End If

If l < m Then

Call swap(l, m)

End If

If m < n Then

Call swap(m, n)

End If

If n < o Then

Call swap(n, o)

End If

 

 

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

If j < k Then

Call swap(j, k)

End If

If k < l Then

Call swap(k, l)

End If

If l < m Then

Call swap(l, m)

End If

If m < n Then

Call swap(m, n)

End If

 

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

If j < k Then

Call swap(j, k)

End If

If k < l Then

Call swap(k, l)

End If

If l < m Then

Call swap(l, m)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

If j < k Then

Call swap(j, k)

End If

If k < l Then

Call swap(k, l)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

If j < k Then

Call swap(j, k)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

If i < j Then

Call swap(i, j)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

If h < i Then

Call swap(h, i)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

If g < h Then

Call swap(g, h)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

If f < g Then

Call swap(f, g)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

If e < f Then

Call swap(e, f)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

If d < e Then

Call swap(d, e)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If c < d Then

Call swap(c, d)

End If

 

If a < b Then

Call swap(a, b)

End If

If b < c Then

Call swap(b, c)

End If

If a < b Then

Call swap(a, b)

End If

 

Print a &"," & b & "," & c & "," & d & "," & e "," & f & "," & g& "," & h & "," & i & ","& j & "," & k & "," & l &"," & m & "," & n & "," & o

End Sub

 

Private Sub swap (x As Integer, y As Integer)

   Dim temp AsInteger

   If x < y Then

   temp = x

   x = y

   y = temp

   End If

   End sub


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值