Option Strict On
Module Module1

    Sub Main()
        Const eps As Double = 0.000001
        Const h As Double = 1.986 * 10 ^ (-16)
        Const k As Double = 1.381 * 10 ^ (-16)
        Dim T As Double
        Dim Tmin As Double = 100
        Dim Tmax As Double = 2000
        Dim dT As Double = 100
        Dim w As Double = 100
        Dim E As Double
        Dim chissum As Double
        Dim chis As Double
        Dim nizsum As Double
        Dim niz As Double
        Dim n As Double
        Console.WriteLine("Частота колебания:     {0}", w)
        Console.WriteLine()
        Console.WriteLine("T    |        Fv   |        (Ev)/h  (см-1)")
        Console.WriteLine("-----------------------------------------")
        For j As Integer = 0 To CInt((Tmax - Tmin) / dT)
            T = Tmin + j * dT
            n = 0
            chis = chissum
            niz = nizsum
            Do
                chissum = (n + 0.5) * h * w * Math.Exp(-(n + 0.5) * h * w / k / T)
                chis = chis + chissum
                nizsum = Math.Exp(-(n + 0.5) * h * w / k / T)
                niz = niz + nizsum
                n = n + 1
            Loop While ((Math.Exp(-(n + 0.5) * h * w / k / T)) > eps)
            E = chis / niz
            Console.WriteLine("{0,4}   |    {1,8:F4}  |   {2:E}", T, niz, E / h)
        Next j
        Console.ReadLine()
    End Sub

End Module
