哪错的排序
2016-04-05 16:47
127 查看
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/doubt.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/doubt.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/doubt.gif)
Option Base1
Private Sub Command1_Click()
Cls
Dim n As Integer
Dim size As Integer
size=Int(Val(Me.Text1.Text))
Dim a() As Integer
ReDim a(size)
n=LBound(a)
while n<=UBound(a)
a(n)=Int(Rnd*1000)
n=n+1
Wend
Dim swap As Integer
m=LBound(a)
While m<=UBound(a)-1
n=LBound(a)
While n《=UBound(a)-m
If a(n)<a(n+1) Then
swap=a(n)
a(n)=a(n+1)
a(n+1)=swap
End If
n=n+1
Wend
m=m+1
Wend
n=LBound(a)
While n<=UBound(a)
Print a(n)
n=n+1
wend
End Sub
唉
相关文章推荐
- Cordova插件,自动根据包名替换R资源描述
- swift 类似九宫格
- math3.util.ArithmeticUtils
- POJ 1077 Eight(八数码A*+IDA*)
- Android 全局异常捕获的完整实践
- Codeforces Round #247(Div. 2) C. k-Tree DP
- jquery1.6中的.prop()和.attr()异同
- pojsupermark
- 基本快速排序
- UNICODE,GBK,UTF-8区别
- 新手提问,按F12那个控制台(?)在右边,怎么设置在下边?
- Java开发中的23种设计模式详解
- 构建之法——第四章读后感
- 如何将中缀式转化成前缀式和后缀式
- maven加载本地库
- springMVC+uploadify3.1 文件上传 demo
- Probe监控Tomcat
- 由外向内生成N*N矩阵
- CF 553A. Kyoya and Colored Balls 组合数学 和dp有点关系
- 输入挂