Advertisement
Guest User

Untitled

a guest
Mar 28th, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Private Sub CommandButton1_Click()
  3. a = Val(TextBox1.Text)
  4. B = Val(TextBox2.Text)
  5. N = Val(TextBox3.Text)
  6. H = (B - a) / N
  7. Label6.Caption = H
  8. For i = 0 To N
  9. x = a + i * H
  10. F = 1 - Sin(x)
  11. Label4.Caption = F
  12. Next i
  13. End Sub
  14.  
  15.  
  16.  
  17. Private Sub CommandButton1_Click()
  18. N = Val(TextBox1.Text)
  19. If (N > 0) Then
  20.     ReDim a(0 To N - 1)
  21.     Label2.Caption = ""
  22.     Label3.Caption = ""
  23.     K = 0
  24.     For i = 0 To N - 1
  25.         a(i) = InputBox("Введите элемент массива А(" & i & ")", "Заполнение массива")
  26.     Next i
  27.     For i = 0 To N - 2
  28.     If (a(i) > a(i + 1)) Then
  29.         Label2.Caption = Label2.Caption & " " & i + 1 & " "
  30.         K = K + 1
  31.     End If
  32.    
  33.     Next i
  34.     Label3.Caption = "Количество элементов больших правого соседа:" & K & " "
  35. End If
  36. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement