Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- a = Val(TextBox1.Text)
- B = Val(TextBox2.Text)
- N = Val(TextBox3.Text)
- H = (B - a) / N
- Label6.Caption = H
- For i = 0 To N
- x = a + i * H
- F = 1 - Sin(x)
- Label4.Caption = F
- Next i
- End Sub
- Private Sub CommandButton1_Click()
- N = Val(TextBox1.Text)
- If (N > 0) Then
- ReDim a(0 To N - 1)
- Label2.Caption = ""
- Label3.Caption = ""
- K = 0
- For i = 0 To N - 1
- a(i) = InputBox("Введите элемент массива А(" & i & ")", "Заполнение массива")
- Next i
- For i = 0 To N - 2
- If (a(i) > a(i + 1)) Then
- Label2.Caption = Label2.Caption & " " & i + 1 & " "
- K = K + 1
- End If
- Next i
- Label3.Caption = "Количество элементов больших правого соседа:" & K & " "
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement