請高手幫我看一下程式碼,哪裡出現問題.......
題目:輸入5個數值資料,計算其總和與平均.
Dim x(4), sum, i
sum = 0
For i = 0 To 5
x(i) = Val(InputBox(\"輸入數值\"))
sum = sum + 1
Next
MsgBox(\"總和=\" & sum)
ps.平均 不會算ㄟ….
2006-03-28 10:10:01 · 2 個解答 · 發問者 ziko 1 in 電腦與網際網路 ➔ 程式設計
Dim x(4), sum, isum = 0For i = 0 To 4 x(i) = Val(InputBox("輸入數值"))sum = sum + x(i)NextMsgBox "總和= " & sum & " 平均= " & sum / 5
2006-03-28 16:20:02 補充:
您把專案的啟動物件改成Form1
2006-03-28 10:31:54 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋
to w.j.s
謝謝你的答案
可是我無法執行,
出現原因是Form 中找不到sub main
是何原因??
2006-03-28 21:26:12 補充:
to W.J.S
謝謝!!OK 沒問題了!!
2006-03-28 10:44:39 · answer #2 · answered by ziko 1 · 0⤊ 0⤋