【正文】
orm_Load() = True 計算1!+3!+5!+……+(2N+1)!End Sub運行結(jié)果:若n輸入的值為5,則程序運行結(jié)果如圖55(1)所示。(2)1+X/2!+X2/4!+X3/6!+……+XN/(2N)!【參考答案】程序代碼設(shè)計Private Sub Command1_Click() x = Val(InputBox(請輸入x值)) n = Val(InputBox(請輸入N值)) Sum = 1 t1 = 1 t2 = 1 For k = 2 To 2 * n Step 2 t1 = t1 * x t2 = t2 * (k 1) * k Sum = Sum + t1 / t2 Next k 1+X/2!+X^2/4!+……+X^N/(2N)!=。 SumEnd SubPrivate Sub Form_Load() = True 計算1+X/2!+X^2/4!+……+X^N/(2N)!End Sub運行結(jié)果:圖55(2)程序運行結(jié)果若x輸入值為:,n輸入值為:5,則程序運行結(jié)果如圖55(2)所示。(3)1+13+135+……+13……(2N+1)【參考答案】程序代碼設(shè)計Private Sub Command1_Click() n = Val(InputBox(請輸入N值)) Sum = 1 term = 1 For k = 3 To 2 * n + 1 Step 2 term = term * k Sum = Sum + term Next k 1+13+135+……+13……(2N+1)=。 SumEnd SubPrivate Sub Form_Load() = True 計算1+13+135+……+13……(2N+1)End Sub運行結(jié)果:若n輸入值為5,則程序運行結(jié)果如圖55(3)所示:圖55(3)程序運行結(jié)果(4)xx3/3!+x5/5!x7/7!+……【參考答案】程序代碼設(shè)計Private Sub Command1_Click() x = Val(InputBox(請輸入x值)) Sum = x t1 = x t2 = 1 f = 1 k = 1 While (t1 / t2 ) k = k + 2 t1 = t1 * x * x t2 = t2 * (k 1) * k圖55(4)程序運行結(jié)果 f = f * (1) Sum = Sum + f * t1 / t2 Wend xx^3/3!+x^5/5!x^7/7!+……=。 SumEnd SubPrivate Sub Form_Load() = True 計算xx^3/3!+x^5/5!x^7/7!+……End Sub運行結(jié)果:若x輸入值為:, 則程序運行結(jié)果如圖55(4)所示:(5)1+1/2+1/3+……+1/N (1/N104)【參考答案】程序代碼設(shè)計Private Sub Form_Click() Sum = 0 k = 1 While (1 / k ) Sum = Sum + 1 / k k = k + 1 Wend