VERSION 5.00
Begin VB.Form frm1 
   BackColor       =   &H00000080&
   Caption         =   "Максимальный элемент"
   ClientHeight    =   3195
   ClientLeft      =   3510
   ClientTop       =   2835
   ClientWidth     =   5490
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   12
      Charset         =   204
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H00FFFFFF&
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   5490
   Begin VB.TextBox txtDim 
      Height          =   975
      Left            =   1440
      MultiLine       =   -1  'True
      TabIndex        =   2
      Top             =   1440
      Width           =   2415
   End
   Begin VB.CommandButton cmdDim 
      Caption         =   "Заполнить массив"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1800
      TabIndex        =   1
      Top             =   2640
      Width           =   1815
   End
   Begin VB.CommandButton cmdMax 
      Caption         =   "Макс. элемент"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1800
      TabIndex        =   0
      Top             =   840
      Width           =   1815
   End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bytA(1 To 10), bytMax, bytI, bytN As Byte
Private Sub cmdDim_Click()
Randomize
For bytI = 1 To 10
bytA(bytI) = Int(Rnd * 10)
txtDim.Text = txtDim.Text + Str(bytA(bytI))
Next bytI
End Sub
Private Sub cmdMax_Click()
bytMax = bytA(1)
For bytI = 2 To 10
If bytA(bytI) > bytMax Then bytMax = bytA(bytI): bytN = bytI
Next bytI
Print "Максимальный элемент "; bytMax; "  его индекс"; bytN
End Sub

