程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> ASP編程 >> ASP技巧 >> 分解質因數(asp 分布遞歸法)

分解質因數(asp 分布遞歸法)

編輯:ASP技巧

***start input.ASP***
<% thenum= request("num") %>
<style type="text/CSS">
<!--
.trees {  border-color: black black black #666666; padding-left: 12px; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 3px; margin-top: 2px; margin-bottom: 2px}
-->
</style>

<div class = "trees" id="tree<%=thenum%>"><%=thenum%><span id="follow<%=thenum%>"><iframe name = "agent<%=thenum%>" src="PRime_number.ASP?num=<%=thenum%>"></iframe></span></div>
***end input.ASP***

***start prime_number.ASP***
<%
IsPrimeNumber = false
thenum = request("num")
if thenum = 2 or thenum = 1 then
    IsPrimeNumber = false
else
    for i = 2 to thenum -1
        if thenum / i = int(thenum / i) then IsPrimeNumber = true: m = i : exit for
    next
end if
if IsPrimeNumber = false then %>

    <script>
    var Htmltext = '<div class = "trees"><%=thenum%>*</div>';
    parent.follow<%=thenum%>.innerHTML = Htmltext;
    </script>

<%else%>
        <%k = thenum / m%>
        <script>
        var Htmltext = '<div class = "trees"><%=m%>*</div><div class = "trees" id="tree<%=k%>"><%=k%><span id="follow<%=k%>"><iframe name = "agent<%=k%>" src="prime_number.ASP?num=<%=k%>"></iframe></span></div>';
        parent.follow<%=thenum%>.innerHTML = Htmltext;
        </script>

<%end if%>
***end prime_number.ASP***

算法應用:分布多線程樹讀取

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved