站长资源网络编程

asp 实现的冒泡排序程序

整理:jimmy2024/10/28浏览2
简介复制代码 代码如下:arr = array(12,52,14,43,24,58,15,64,24,57,17,56,45) arrLen = ubound(arr) for i=0 to arrLen-1 for j = 0 to (arrlen -1)-i if arr(j)>arr(j+1) t
复制代码 代码如下:
arr = array(12,52,14,43,24,58,15,64,24,57,17,56,45)
arrLen = ubound(arr)

for i=0 to arrLen-1
for j = 0 to (arrlen -1)-i
if arr(j)>arr(j+1) then
temp = arr(j)
arr(j)= arr(j+1)
arr(j+1) = temp
end if
next
next

for each l in arr
response.Write l&"<br>"
next