史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   一般電腦疑難討論區 (http://forum.slime.com.tw/f17.html)
-   -   asp語言程式作業: (http://forum.slime.com.tw/thread78265.html)

jinwen 2003-10-23 11:33 PM

asp語言程式作業:
 
asp語言程式作業:
題目:從1+2+3+........+100
當累計大於5000跳離!
請問INT Tatal是多少?

答案寫這樣是否正確?
<!-- 程式範例:Ch4-3-4.asp -->
<html>
<head>
<title>Exit For中斷For迴路</title>
</head>
<body>
<center><h2>測試For Each/Exit For/Next迴路</h2></center>
<hr>
<%
' 變數宣告
Dim intI, intJ, intTotal
intTotal = 0 ' 初始值
intJ = 5000 ' 中斷值
' 迴路
For intI = 100 To 1 Step -1
intTotal = intTotal + intI
If intTotal > intJ Then
Exit For
End If
Next
Response.Write("從100加到" & inti & "大於: " & intj & "<br>")
Response.Write("inti為" & inti & "intTotal等於 " & intTotal & "<br>")
%>
</body>
</html>

snoopy 2003-10-23 11:55 PM

http://www.hkln.net/

參考一下


所有時間均為台北時間。現在的時間是 12:06 PM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2025, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1