VERSION 5.00 Begin VB.Form Form1 Caption = "12 элементов" ClientHeight = 2580 ClientLeft = 3630 ClientTop = 3345 ClientWidth = 5310 BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "Element.frx":0000 LinkTopic = "Form1" MousePointer = 4 'Icon ScaleHeight = 2580 ScaleWidth = 5310 Begin VB.CommandButton Command3 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 2040 MouseIcon = "Element.frx":0442 Picture = "Element.frx":0D0C Style = 1 'Graphical TabIndex = 8 ToolTipText = "Play FL Studio" Top = 1440 Width = 1215 End Begin VB.CommandButton Command2 Cancel = -1 'True 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 = 495 Left = 2040 TabIndex = 6 ToolTipText = "Для завершения работы программы нажмите кнопку ""Выход""." Top = 2040 Width = 1215 End Begin VB.CommandButton Command1 Caption = "Р&аспечатать" Default = -1 'True BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 2040 TabIndex = 5 ToolTipText = "Для печати данного массива одним из способов нажмите кнопку ""Распечатать""" Top = 840 Width = 1215 End Begin VB.PictureBox Picture4 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 4320 ScaleHeight = 795 ScaleWidth = 915 TabIndex = 3 ToolTipText = "Вывод массива четвёртым способом" Top = 1680 Width = 975 End Begin VB.PictureBox Picture3 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 3360 ScaleHeight = 795 ScaleWidth = 915 TabIndex = 2 ToolTipText = "Вывод массива третьим способом" Top = 1680 Width = 975 End Begin VB.PictureBox Picture2 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 4320 ScaleHeight = 795 ScaleWidth = 915 TabIndex = 1 ToolTipText = "Вывод массива вторым способом" Top = 840 Width = 975 End Begin VB.PictureBox Picture1 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 3360 ScaleHeight = 795 ScaleWidth = 915 TabIndex = 0 ToolTipText = "Вывод массива первым способом" Top = 840 Width = 975 End Begin VB.Image Image1 Height = 1725 Left = 0 Picture = "Element.frx":1AAE ToolTipText = "Способы печати данного массива" Top = 840 Width = 1965 End Begin VB.Label Label2 Alignment = 2 'Center Caption = "11, 28, 73, 44, 51, 99, 39, 62, 92, 87, 26, 41." BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H8000000D& Height = 255 Left = 720 TabIndex = 7 ToolTipText = "Данный массив" Top = 360 Width = 3975 End Begin VB.Label Label1 Caption = $"Element.frx":CCD4 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 120 TabIndex = 4 ToolTipText = "Задание" Top = 0 Width = 5055 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim st, s, str, mas As String Dim h As Integer Dim mas3(1 To 3, 1 To 4) As Integer Dim mas4(1 To 4, 1 To 3) As Integer Dim A(1 To 12) As Integer Private Sub Command1_Click() Picture1.Cls Picture2.Cls Picture3.Cls Picture4.Cls h = 0 mas = "" s = MsgBox("Вы хотите распечатать данный массив" & Chr(13) & Chr(10) & "одним из представленных способов?", vbYesNo + vbQuestion, "Что делать?") If s = vbYes Then st = "11 28 73 44 51 99 39 62 92 87 26 41" A1 = Split(st, " ") For i = 1 To 12 A(i) = Val(A1(i - 1)) Next d = Val(InputBox("Каким из представленных способов Вы бы хотели" & Chr(13) & Chr(10) & "распечатать данный массив?:", "Выбор способа печати", "1")) 'Первый (общий) способ распечатки массива по строкам: 'Первый сбособ: If d = 1 Then For i = 1 To 3 str = "" For j = 1 To 4 h = h + 1 str = str & A(h) & " " Next mas = mas & str & Chr(13) & Chr(10) Next Picture1.Print mas 'Второй сбособ: ElseIf d = 2 Then For i = 1 To 4 str = "" For j = 1 To 3 h = h + 1 str = str & A(h) & " " Next mas = mas & str & Chr(13) & Chr(10) Next Picture2.Print mas 'Третий сбособ: ElseIf d = 3 Then For i = 1 To 3 For j = 1 To 4 h = h + 1 mas3(i, j) = A(h) Next Next For j = 1 To 4 str = "" For i = 1 To 3 str = str & mas3(i, j) & " " Next mas = mas & str & Chr(13) & Chr(10) Next Picture3.Print mas 'Четвёртый сбособ (и прочие другие, которые больше 4): ElseIf Val(d) > 3 Then For i = 1 To 4 For j = 1 To 3 h = h + 1 mas4(i, j) = A(h) Next Next For j = 1 To 3 str = "" For i = 1 To 4 str = str & mas4(i, j) & " " Next mas = mas & str & Chr(13) & Chr(10) Next Picture4.Print mas Else MsgBox " Это значение недопустимо!" & Chr(13) & Chr(10) & "Введите одно из допустимых значений 1, 2, 3 или 4.", vbOKOnly + vbExclamation, "Недопустимое значение" End If End If ''Второй (частный) способ распечатки массива по строкам: ''Первый сбособ: 'If d = 1 Then 'Picture1.Print "11 28 73 44" & Chr(13) & Chr(10) & "51 99 39 62" & Chr(13) & Chr(10) & "92 87 26 41" ''Второй сбособ: 'ElseIf d = 2 Then 'Picture2.Print "11 28 73" & Chr(13) & Chr(10) & "44 51 99" & Chr(13) & Chr(10) & "39 62 92" & Chr(13) & Chr(10) & "87 26 41" ''Третий сбособ: 'ElseIf d = 3 Then 'Picture3.Print "11 51 92" & Chr(13) & Chr(10) & "28 99 87" & Chr(13) & Chr(10) & "73 39 26" & Chr(13) & Chr(10) & "44 62 41" ''Четвёртый сбособ (и прочие другие, которые больше 4): 'ElseIf Val(d) > 3 Then 'Picture4.Print "11 44 39 87" & Chr(13) & Chr(10) & "28 51 62 26" & Chr(13) & Chr(10) & "73 99 92 41" 'Else 'MsgBox " Это значение недопустимо!" & Chr(13) & Chr(10) & "Введите одно из допустимых значений 1, 2, 3 или 4.", vbOKOnly + vbExclamation, "Недопустимое значение" 'End If 'End if End Sub Private Sub Command2_Click() End End Sub Private Sub Command3_Click() Shell ("C:\Progra~1\FLStudio4\FL.exe C:\Progra~1\FLStudio4\Data\Patches\Packs\MySounds\Element.flp") Shell ("C:\Progra~1\Winamp\winamp.exe C:\Progra~1\Winamp\winamp.m3u") End Sub