Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module Module1
  2.  
  3.     Sub Main()
  4.         ' Задаём нужные нам переменные
  5.        Dim h, x, y, f0, x1, y1 As Double
  6.        Dim row As Integer
  7.  
  8.        ' Значения по-умолчанию
  9.         Const x0 = 0
  10.         Const y0 = 1
  11.         Const xk = 1
  12.         Const n = 10
  13.  
  14.         ' Высчитываем h, x, y, row
  15.        h = (xk - x0) / n
  16.        x = x0
  17.        y = y0
  18.        row = 4
  19.  
  20.        ' Наш цикл
  21.         While x < xk
  22.             f0 = x * y
  23.             x1 = x + h / 2
  24.             y1 = y + f0 * h / 2
  25.             y = y + x1 * y1 * h
  26.             x = x + h
  27.             row = row + 1
  28.             Console.WriteLine(CStr(row) + " " + CStr(x) + " " + CStr(y))
  29.         End While
  30.     End Sub
  31.  
  32. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement