VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Изменение массива"
   ClientHeight    =   7545
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8925
   LinkTopic       =   "Form1"
   ScaleHeight     =   7545
   ScaleWidth      =   8925
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command3 
      Caption         =   "Выход"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7560
      TabIndex        =   2
      Top             =   6960
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Пуск2"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6240
      TabIndex        =   1
      Top             =   6960
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Пуск1"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4920
      TabIndex        =   0
      Top             =   6960
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim chas As Integer, minut As Integer, m As Integer, n As Integer, fl(1 To 2) As Boolean, Min As Integer, cc As Integer, kk As Integer, c As Integer, k As Integer, r As Integer, a(1 To 40) As Integer, b(1 To 40, 1 To 40) As Integer, i As Integer, j As Integer
Private Sub Command1_Click()
 Randomize (Timer)
 Form1.FontSize = 12
 Form1.ForeColor = &HC000C0
 Form1.FontBold = True
   Form1.FontUnderline = True
Form1.Cls
 Form1.Print "1-й массив - одномерный (линейный) случайных целых чисел"
  Form1.FontUnderline = False
   Form1.ForeColor = 255
For i = 1 To m
 a(i) = Int(Rnd * 900 + 100)
 Form1.Print a(i);
Next
fl(1) = True
fl(2) = False
Command4.Enabled = True
Command7.Enabled = True
Command8.Enabled = False

End Sub

Private Sub Command2_Click()
 Randomize (Timer)
 Form1.FontSize = 12
 Form1.ForeColor = &HC000C0
 Form1.FontItalic = True
 Form1.FontBold = True
  Form1.FontUnderline = True
Form1.Cls
 Form1.Print "2-й массив - двумерный (таблица) случайных целых чисел"
 Form1.FontItalic = False
  Form1.FontUnderline = False
   Form1.ForeColor = 255

For i = 1 To n
 For j = 1 To m
 b(i, j) = Int(Rnd * 900 + 100)
 Form1.Print b(i, j);
Next
Form1.Print
Next
fl(2) = True
fl(1) = False
Command8.Enabled = True
Command7.Enabled = True
Command4.Enabled = False

End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()

End Sub
Private Sub Form_Click()
If fl(1) = True Then
 Form1.FontSize = 12
 Form1.ForeColor = &HC000C0
 Form1.FontBold = True
   Form1.FontUnderline = True
Form1.Cls
 Form1.Print "1-й массив - одномерный (линейный) случайных целых чисел"
  Form1.FontUnderline = False
   Form1.ForeColor = 555555

Min = a(1)
 c = 1
For i = 1 To m
 If Min > a(i) Then
 c = i
 Min = a(i)
 End If
Next
cc = 0
For i = 1 To m
  If Min = a(i) Then
   cc = cc + 1
   Form1.ForeColor = 255
   Form1.Print a(i);
   Else
   Form1.ForeColor = 555555
   Form1.Print a(i);
  End If
  Form1.ForeColor = 255
Next

Form1.Print
Form1.Print
Form1.Print "min="; Min, cc; "шт"
End If

If fl(2) = True Then
 Form1.FontSize = 12
 Form1.ForeColor = &HC000C0
 Form1.FontItalic = True
 Form1.FontBold = True
  Form1.FontUnderline = True
Form1.Cls
 Form1.Print "2-й массив - двумерный (таблица) случайных целых чисел"
 Form1.FontItalic = False
  Form1.FontUnderline = False
   Form1.ForeColor = 555555

Min = b(1, 1)
 c = 1
 kk = 1

For i = 1 To n
For j = 1 To m
 If Min > b(i, j) Then
 Min = b(i, j)
 c = i
 kk = j
 End If
 
Next
Next
cc = 0
For i = 1 To n
 For j = 1 To m
  If Min = b(i, j) Then
   cc = cc + 1
   Form1.ForeColor = 255
   Form1.Print b(i, j);
   Else
   Form1.ForeColor = 555555
   Form1.Print b(i, j);
  End If
   Form1.ForeColor = 255
 Next
 Form1.Print
Next

 Form1.Print
Form1.Print "min="; Min, cc; "шт"
End If

End Sub

