⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 +

📁 筛选和冒泡排序的代码
💻
字号:
VERSION 5.00
Begin VB.Form 筛选排序 
   Caption         =   "Form1"
   ClientHeight    =   6525
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6990
   LinkTopic       =   "Form1"
   ScaleHeight     =   6525
   ScaleWidth      =   6990
   StartUpPosition =   3  'Windows Default
End
Attribute VB_Name = "筛选排序"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Sort(a() As Integer)
Dim i As Integer, j As Integer
Dim temp As Integer
For i = 1 To UBound(a) - 1
    For j = i + 1 To UBound(a)
        If a(i) > a(j) Then
            temp = a(i)
            a(i) = a(j)
            a(j) = temp
        End If
    
    Next
Next
End Sub
Private Sub Form_click()
Dim Mdarray(10) As Integer
Dim i As Integer
Print "排序前:"
For i = 1 To 10
    Mdarray(i) = Int(100 * Rnd(2))
    Print Mdarray(i);
Next
Print
Print "排序后:"
Call Sort(Mdarray)
For i = 1 To 10
    
    Print Mdarray(i);
Next
Print

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -