当前位置: 首页 > 图文教程 > 网络编程 > ASP > 分解质因数(asp 分布递归法)

ASP
VPN技术详解(下)
微软Page Counter 组件参考(一)
微软Page Counter 组件参考(二)
@ 指令参考之一 - @CODEPAGE
@ 指令参考之二 - @ENABLESESSIONSTATE
@ 指令参考之三 - @LANGUAGE
@ 指令参考之四 - @LCID
@ 指令参考之五 - @TRANSACTION
SQL数据操作基础(初级) 1
SQL数据操作基础(初级) 2
SQL数据操作基础(初级) 3
Response对象1
Response对象2
Response对象3
Response对象4
Response对象5
WSH简介
WSH实用讲座:第一讲 获取机器的网络属性配置
WSH实用讲座---第二讲 创建用户、目录和站点
WSH实用讲座---第三讲 创建邮箱

ASP 中的 分解质因数(asp 分布递归法)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 49 ::
收藏到网摘: n/a

  ***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%>" style="display:none" 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%>" style="display:none" src="prime_number.asp?num=<%=k%>"></iframe></span></div>';
        parent.follow<%=thenum%>.innerHTML = htmltext;
        </script>

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

算法应用:分布多线程树读取