VERSION 5.00 Begin VB.Form Form1 BackColor = &H00FF0000& Caption = "Summa" ClientHeight = 2775 ClientLeft = 2985 ClientTop = 2685 ClientWidth = 6135 Icon = "SUMMA.frx":0000 LinkTopic = "Form1" ScaleHeight = 2775 ScaleWidth = 6135 Begin VB.CommandButton Command2 Caption = "В&ыход" Height = 495 Left = 4680 TabIndex = 1 Top = 2160 Width = 1335 End Begin VB.CommandButton Command1 Caption = "&Вычислить" Height = 495 Left = 4680 TabIndex = 0 Top = 1440 Width = 1335 End Begin VB.Image Image1 Height = 675 Left = 4200 Picture = "SUMMA.frx":0442 Top = 0 Width = 1155 End Begin VB.Line Line6 X1 = 6120 X2 = 6120 Y1 = 0 Y2 = 2760 End Begin VB.Line Line5 X1 = 0 X2 = 0 Y1 = 0 Y2 = 2760 End Begin VB.Line Line4 X1 = 0 X2 = 6120 Y1 = 2760 Y2 = 2760 End Begin VB.Line Line3 X1 = 0 X2 = 6120 Y1 = 2040 Y2 = 2040 End Begin VB.Line Line2 X1 = 0 X2 = 6120 Y1 = 1320 Y2 = 1320 End Begin VB.Line Line1 X1 = 0 X2 = 6120 Y1 = 0 Y2 = 0 End Begin VB.Label Label2 BackColor = &H00FF00FF& Caption = "Для вычисления конечной суммы данного ряла, нажмите кнопку ""&Вычислить"" и Вы получите "" О Т В Е Т "" ." Height = 495 Left = 120 TabIndex = 5 Top = 1320 Width = 4455 End Begin VB.Label Label3 BackColor = &H00FFFFFF& Caption = "Для завершения работы программы нажмите кнопку ""&Выход""." Height = 495 Left = 120 TabIndex = 4 Top = 2160 Width = 4455 End Begin VB.Label Label4 Alignment = 2 'Center BackColor = &H00000000& Caption = " О Т В Е Т" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 255 Left = 120 TabIndex = 3 Top = 1800 Width = 4455 End Begin VB.Label Label1 BackColor = &H0000FFFF& Caption = $"SUMMA.frx":2D4C Height = 1215 Left = 120 TabIndex = 2 Top = 120 Width = 5895 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Function f(k As Integer) Dim i As Integer f = 1 For i = 1 To k f = f * i Next End Function Private Sub Command1_Click() Dim i As Integer Const e As Double = 0.00001 Dim s As Double, c As Double s = 0 c = 1 i = 1 Do While Abs(c) > e c = f(i) / (f(4 + i)) s = s + c i = i + 1 Loop Label4.Caption = Format(s, "00.00000") + " " + Str(i) End Sub Private Sub Command2_Click() Unload Me End Sub