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

ASP
ASP制作迅雷看看电影人气指数
Request.ServerVariables参数
rs.open和conn.execute
Rs.Open参数
什么是会话ID和如何使用会话ID
Service Unavailable问题
一些关于购物车的想法
几种常见的保护数据库的方法
验证码不正确,该如何解决?
ASP教程:过滤HTML代码并截取
IIS7中HTTP 500错误
学习ASP基础教程
ASP教程:ASP基础语法
学习ASP获取HTML表单提交信息的实例
301重定向全面认识
介绍一些常见的ASP平台的CMS
正则表达式简单学习
ASP教程:server.transfer方法实例
ASP实例教程代码实现禁止外部提交数据
ASP简单入门教程(1):认识ASP

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 129 ::
收藏到网摘: 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***

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