[ASP.net ] 請教counter問題?

看板Visual_Basic作者 (優羅志大學學生代表)時間17年前 (2006/11/22 19:27), 編輯推噓3(301)
留言4則, 2人參與, 最新討論串1/1
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
應該要用Session存吧?
11/22 23:14, 1F

11/22 23:22, , 2F
對不起看錯了@@
11/22 23:22, 2F

11/22 23:23, , 3F
while x<4 應該是 x<5 吧?
11/22 23:23, 3F

11/23 06:46, , 4F
While x <= 4
11/23 06:46, 4F
文章代碼(AID): #15P3GCgS (Visual_Basic)