寫一程式計算:
(1)Sum=4+9+14+19+....+99
(2)Sum=(1-1/2)(1-1/3)(1-1/4)...(1-1/N)(註:先輸入N)
請大家幫幫忙
很急
該怎麼寫出他的程式
謝謝
2006-06-23 10:37:06 · 1 個解答 · 發問者 Anonymous in 電腦與網際網路 ➔ 程式設計
'第1題Private Sub Command1_Click() Dim I%, Sum% For I = 4 To 99 Step 5 Sum = Sum + I Next Print SumEnd Sub'第2題Private Sub Command2_Click() Dim I%, Sum!, N% Do N = Int(Val(InputBox("請輸入大於1之整數"))) Loop Until N > 1 Sum = 1 For I = 2 To N Sum = Sum * (1 - 1 / I) Next Print SumEnd Sub
2006-06-23 11:07:27 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋