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

📄 例11.frm

📁 在VB5环境下开发的VB程序集,窗体控件源代码.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FRM6_5_2 
   BackColor       =   &H00FF8080&
   Caption         =   "6-5-2:数组实例2--10个数排序"
   ClientHeight    =   4695
   ClientLeft      =   210
   ClientTop       =   1260
   ClientWidth     =   8985
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   15.75
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   4695
   ScaleWidth      =   8985
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   2160
      TabIndex        =   6
      Top             =   3360
      Width           =   6735
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   2160
      TabIndex        =   5
      Top             =   2520
      Width           =   6735
   End
   Begin VB.CommandButton Command2 
      Caption         =   "排  序"
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Top             =   3360
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "产生随机数"
      Height          =   495
      Left            =   120
      TabIndex        =   3
      Top             =   2520
      Width           =   1815
   End
   Begin VB.Label Label3 
      BackColor       =   &H000000FF&
      Caption         =   "1、利用循环和随机函数Rnd[(number)],产生10个随机数,放于数组中。         2、利用“冒泡”法,采用双重循环进行排序。"
      ForeColor       =   &H00FFFFFF&
      Height          =   1335
      Left            =   1560
      TabIndex        =   2
      Top             =   840
      Width           =   6015
   End
   Begin VB.Label Label2 
      BackColor       =   &H0000FF00&
      Caption         =   "解题思路"
      ForeColor       =   &H00C00000&
      Height          =   1335
      Left            =   960
      TabIndex        =   1
      Top             =   840
      Width           =   375
   End
   Begin VB.Label Label1 
      BackColor       =   &H0080FFFF&
      Caption         =   "计算机随机产生10个整数,然后按升序输出"
      Height          =   375
      Left            =   1560
      TabIndex        =   0
      Top             =   240
      Width           =   6015
   End
End
Attribute VB_Name = "FRM6_5_2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a(1 To 10)
Private Sub Command1_Click()
Randomize
Text1 = ""
For i = 1 To 10
a(i) = Int(Rnd() * 100)
Text1 = Text1 + Str(a(i)) + ","
Next i
End Sub

Private Sub Command2_Click()
Text2 = ""
For i = 1 To 9
  For j = i + 1 To 10
  If a(i) > a(j) Then t = a(i): a(i) = a(j): a(j) = t
  Next j
Next i

For i = 1 To 10
Text2 = Text2 + Str(a(i)) + ","
Next i
End Sub

⌨️ 快捷键说明

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