Option Strict On
Module Module1
    Function f(ByVal x As Double) As Double
        Return 3 * Math.Log(x + 1) / (1 + Math.Log(x + 1))
    End Function

    Function int(ByVal a As Double, ByVal b As Double) As Double
        Dim dx As Double = 0.1
        Dim H As Double
        For q As Integer = 1 To CInt(((b - a) / dx) - 1)
            H = H + dx * (f(q * dx + a))
        Next q
        H = H + dx / 2 * (f(a) + f(b))
        Return H
    End Function
    Sub Main()
        Dim Tmax As Double = 300
        Dim Tmin As Double = 0
        Dim T As Double
        Dim dT As Double = 50
        Dim a As Double = 0
        Dim b As Double = 300
        Dim dz As Double = 0.1
        Console.WriteLine(" Шаг интегрирования по t:  {0:f2}", dz)
        Console.WriteLine()
        Console.WriteLine("        T        Cp           H(T)")
        Console.WriteLine(" ------------------------------------")

        For e As Integer = 0 To CInt((Tmax - Tmin) / dT)
            T = Tmin + e * dT
            If T = 0 Then
                Console.WriteLine("  {0,8}     {1,-7:F0}   {2:F0}  ", T, f(T), int(0, T))
            Else
                Console.WriteLine("  {0,8}     {1,-7:F5}   {2:F5}  ", T, f(T), int(0, T))
            End If
Next e
        Console.ReadLine()
    End Sub

End Module
