[ASP.net ] 請教counter問題?
1.想要在網址上讀入一個變數 n 接著按enter
2.重複執行step1 五次 (n這個變數不變)
3.最後第五次 會秀出 前面輸入四次的(包括第五次的值)之總和
我一直無法得到正確的解答..小弟寫的程式如下..
懇請各位先進的指導.. 謝謝
<%
Dim x as integer
Dim tot as integer
tot=0
x=0
Dim arry(4)
while x<4
arry(x) = Cint(request("n"))
x=x+1
response.write(arry(x) & "<br>")
end while
for x=0 to 4
tot = tot+arry(x)
next
response.write(tot)
%>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.249.8.124
推
11/22 23:14, , 1F
11/22 23:14, 1F
推
11/22 23:22, , 2F
11/22 23:22, 2F
→
11/22 23:23, , 3F
11/22 23:23, 3F
推
11/23 06:46, , 4F
11/23 06:46, 4F