VERSION 5.00 Begin VB.Form Form1 BackColor = &H00FFFF00& Caption = "Среднее арифметическое" ClientHeight = 4695 ClientLeft = 2985 ClientTop = 2010 ClientWidth = 6375 FillColor = &H80000012& Icon = "ARIFM.frx":0000 LinkTopic = "Form1" ScaleHeight = 4695 ScaleWidth = 6375 Begin VB.PictureBox Picture1 Height = 375 Left = 120 ScaleHeight = 315 ScaleWidth = 6075 TabIndex = 4 ToolTipText = "Вывод результатов" Top = 3240 Width = 6135 End Begin VB.CommandButton Command4 Cancel = -1 'True Caption = "В&ыход" Height = 375 Left = 4800 TabIndex = 3 ToolTipText = "Для завершения работы программы нажмите кнопку ""Выход""." Top = 3840 Width = 1455 End Begin VB.CommandButton Command3 Caption = "Зам&енить" Height = 375 Left = 3240 TabIndex = 2 ToolTipText = "Чтобы из всех чисел m вычесть их среднее арифметическое, нажмите кнопку ""Заменить""." Top = 3840 Width = 1455 End Begin VB.CommandButton Command2 Caption = "Н&айти" Height = 375 Left = 1680 TabIndex = 1 ToolTipText = "Чтобы найти среднее арифметическое чисел m, нажмите кнопку ""Найти""." Top = 3840 Width = 1455 End Begin VB.CommandButton Command1 Caption = "В&вод" Height = 375 Left = 120 TabIndex = 0 ToolTipText = "Для начала ввода данных нажмите кнопку ""Ввод""." Top = 3840 Width = 1455 End Begin VB.Line Line8 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 4680 Y2 = 4680 End Begin VB.Line Line10 X1 = 6360 X2 = 6360 Y1 = 0 Y2 = 4680 End Begin VB.Line Line9 BorderWidth = 2 X1 = 0 X2 = 0 Y1 = 0 Y2 = 4680 End Begin VB.Line Line7 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 4320 Y2 = 4320 End Begin VB.Label Label6 Alignment = 2 'Center BackColor = &H00FFFF00& Caption = "Для завершения работы программы нажмите кнопку ""В&ыход""." BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000C000& Height = 255 Left = 120 TabIndex = 10 Top = 4440 Width = 6135 End Begin VB.Line Line6 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 3720 Y2 = 3720 End Begin VB.Label Label5 BackColor = &H00FFFF00& Caption = $"ARIFM.frx":34CA BeginProperty Font Name = "Arial" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 615 Left = 120 TabIndex = 9 ToolTipText = "Условие" Top = 2400 Width = 6135 End Begin VB.Line Line3 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 1800 Y2 = 1800 End Begin VB.Line Line5 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 3120 Y2 = 3120 End Begin VB.Line Line4 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 2280 Y2 = 2280 End Begin VB.Line Line2 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 1080 Y2 = 1080 End Begin VB.Line Line1 BorderWidth = 2 X1 = 0 X2 = 6360 Y1 = 0 Y2 = 0 End Begin VB.Label Label4 BackColor = &H00FFFF00& Caption = "Чтобы найти среднее арифметическое чисел m, нажмите кнопку ""Н&айти"". Резльтат появится в графическом окне." BeginProperty Font Name = "Arial" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 495 Left = 120 TabIndex = 8 ToolTipText = "Условие" Top = 1800 Width = 6135 End Begin VB.Label Label3 BackColor = &H00FFFF00& Caption = $"ARIFM.frx":357D BeginProperty Font Name = "Arial" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 615 Left = 120 TabIndex = 7 ToolTipText = "Условие" Top = 1080 Width = 6135 End Begin VB.Label Label2 BackColor = &H00FFFF00& Caption = $"ARIFM.frx":3646 BeginProperty Font Name = "Times New Roman" Size = 9.75 Charset = 204 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty ForeColor = &H00008000& Height = 735 Left = 240 TabIndex = 6 ToolTipText = "Задание" Top = 360 Width = 5895 End Begin VB.Label Label1 Alignment = 2 'Center BackColor = &H00FFFF00& Caption = """Среднее арифмитеческое m чисел.""" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 204 Weight = 700 Underline = -1 'True Italic = -1 'True Strikethrough = 0 'False EndProperty ForeColor = &H8000000D& Height = 375 Left = 600 TabIndex = 5 Top = 0 Width = 5175 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim m As Integer Dim s As Integer Dim arifm As Integer Dim A(1 To 100) As Double Private Sub Command1_Click() s = 0 Picture1.Cls m = Val(InputBox("Введите количество чисел m.", "Ввод количества чисел m", "5")) A1 = Split(InputBox("Введите значения " & m & " чисел. Между числами" & Chr(13) & Chr(10) & "используйте пробел как разделитель.", "Ввод последовательности чисел m"), " ") For i = 1 To m A(i) = Val(A1(i - 1)) s = s + A(i) Picture1.Print A(i); " "; Next End Sub Private Sub Command2_Click() Picture1.Cls arifm = s / m Picture1.Print "Среднее арифметическое " & m & " чисел равно " & arifm & "." End Sub Private Sub Command3_Click() For i = 1 To m A(i) = A(i) - arifm Next Picture1.Cls For i = 1 To m Picture1.Print A(i); " "; Next End Sub Private Sub Command4_Click() End End Sub