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

📄 form1.frm

📁 筛选和冒泡排序的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5460
   ClientLeft      =   120
   ClientTop       =   420
   ClientWidth     =   11550
   LinkTopic       =   "Form1"
   ScaleHeight     =   5460
   ScaleWidth      =   11550
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   855
      Left            =   840
      TabIndex        =   0
      Top             =   3840
      Width           =   2295
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim a(10) As Integer, i As Integer, j As Integer, temp As Integer
    Print "排序前"
    For i = 1 To 10
        a(i) = Int(Rnd * (99 - 10 + 1) + 10)
        
        Print a(i);
    Next
     Print "排序后";
     For i = 1 To UBound(a) - 1
        For j = 1 To UBound(a) - i
            If a(j) > a(j + 1) Then
            temp = a(j)
            a(j) = a(j + 1)
            a(j + 1) = temp
            End If
           
            Print a(j);
        Next
    
    Next
        
End Sub

⌨️ 快捷键说明

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