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

📄 d7r10.frm

📁 常用的数值算法的VB程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4635
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6495
   LinkTopic       =   "Form1"
   ScaleHeight     =   4635
   ScaleWidth      =   6495
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   375
      Left            =   4680
      TabIndex        =   0
      Top             =   3960
      Width           =   1215
   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()
    'PROGRAM D7R10
    'Driver for routine ECLASS
    N = 15: M = 11
    Dim LISTA(11), LISTB(11), NF(15), NFLAG(15), NSAV(15)
    LISTA(1) = 1: LISTA(2) = 1: LISTA(3) = 5:  LISTA(4) = 2: LISTA(5) = 6
    LISTA(6) = 2: LISTA(7) = 7: LISTA(8) = 11: LISTA(9) = 3: LISTA(10) = 4
    LISTA(11) = 12
    LISTB(1) = 5:  LISTB(2) = 9: LISTB(3) = 13: LISTB(4) = 6:  LISTB(5) = 10
    LISTB(6) = 14: LISTB(7) = 3: LISTB(8) = 7:  LISTB(9) = 15: LISTB(10) = 8
    LISTB(11) = 4
    Call ECLASS(NF(), N, LISTA(), LISTB(), M)
    Print "NF(I)=, (I=1,N)"
    For I = 1 To N
        Print Tab(1 + (I - 1) * 4); NF(I);
    Next I
    Print
    For I = 1 To N
        NFLAG(I) = 1
    Next I
    Print
    Print "Numbers from 1-15 divided according to"
    Print
    Print "their value modulo 4:"
    Print
    LCLAS = 0
    For I = 1 To N
        NCLASS = NF(I)
        If NFLAG(NCLASS) <> 0 Then
            NFLAG(NCLASS) = 0
            LCLAS = LCLAS + 1
            K = 0
            For J = 1 To N
                If NF(J) = NF(I) Then
                    K = K + 1
                    NSAV(K) = J
                End If
            Next J
            Print "Class"; LCLAS; ":  ";
            For J = 1 To K
                Print Format$(NSAV(J), "##0"); "  ";
            Next J
            Print
        End If
    Next I
End Sub
Sub ECLASS(NF(), N, LISTA(), LISTB(), M)
    For K = 1 To N
        NF(K) = K
    Next K
    For L = 1 To M
        J = LISTA(L)
        While NF(J) <> J
              J = NF(J)
        Wend
        K = LISTB(L)
        While NF(K) <> K
            K = NF(K)
        Wend
        If J <> K Then NF(J) = K
    Next L
    For J = 1 To N
        While NF(J) <> NF(NF(J))
            NF(J) = NF(NF(J))
        Wend
    Next J
End Sub


⌨️ 快捷键说明

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