VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4980 ClientLeft = 60 ClientTop = 450 ClientWidth = 7800 LinkTopic = "Form1" ScaleHeight = 4980 ScaleWidth = 7800 StartUpPosition = 3 'Windows Default Begin VB.TextBox Text1 BeginProperty DataFormat Type = 1 Format = "# ##0,000000" HaveTrueFalseNull= 0 FirstDayOfWeek = 0 FirstWeekOfYear = 0 LCID = 1049 SubFormatType = 1 EndProperty Height = 375 Left = 120 TabIndex = 2 Text = "0" Top = 1680 Width = 2175 End Begin VB.CommandButton Command2 Caption = "Задача 2" Height = 615 Left = 2520 TabIndex = 1 Top = 1560 Width = 1575 End Begin VB.CommandButton Command1 Caption = "Задача 1" Height = 615 Left = 2520 TabIndex = 0 Top = 600 Width = 1575 End Begin VB.Label Label1 Alignment = 2 'Center Caption = "Задайте значение Х" Height = 255 Left = 120 TabIndex = 3 Top = 1320 Width = 2055 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub Command1_Click() Const e = 4.7 Const DB = 0.4 Const DH = 0.5 Dim C As Double, l As Double Dim s As String s = "" For l = 1 To 3 C = (0.241 * e * l + 0.08 * DH) / Log(DH / DB) * Log(10) s = s & "l=" & CStr(l) & ", C=" & Format(C, "##0.000") & vbCrLf Next l MsgBox s, vbInformation, "Результаты расчета" End Sub Private Sub Command2_Click() Dim x As Double, y As Double, Pi As Double Pi = 4 * Atn(1) x = CDbl(Text1.Text) Select Case x Case Is < 0 y = -x Case Is <= 1 y = x * (x - 1) Case Else y = x ^ 2 - Sin(Pi * x ^ 2) End Select MsgBox "x=" & CStr(x) & ", y=" & Format(y, "# ##0.00000"), vbInformation, "Результат" End Sub