用VBScript编程:在浏览器中输出1---999中能被3整除,且至少有一位数字是5的所有整数

来源:百度知道 编辑:UC知道 时间:2024/07/04 22:44:35

两种方法:
1。
<%
dim t
for i=1 to 999
if i mod 3 =0 then
t=cstr(i)
for j=1 to len(t)
m=left(t,j)
m=right(m,1)
if m="5" then
response.write(i)
response.write("<br>")
exit for
end if
next
end if
next
%>
或者
2
<%
dim t
for i=1 to 999
if i mod 3 =0 then
if instr(cstr(i),"5")<>0 then
response.write(i)
response.write("<br>")
end if
end if
next
%>
刚整出来,整了半个小说,已经测试过。