分解质因数(asp 分布递归法)
2002-02-25 10:24:27 来源:WEB开发网核心提示:***start input.asp***<% thenum= request("num") %><style type="text/CSS"><!--.trees {border-color: black black black #666666;
***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***
算法应用:分布多线程树读取
<% 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***
算法应用:分布多线程树读取
- ››asp.net页面弄成伪静态页面
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
赞助商链接