面试啦 - 提供专业面试问题及答案、面试技巧、助您成功面试!
您的当前位置:首页 > 面试题库 > IT面试题 > ASP面试题 > 正文

用ASP输出九九乘法口决表的网页

输出如下:
1*1=1
1*2=2 2*2=4
1*3=3 2*3=6 3*3=9
———————-
———————-
请写出完整的ASP代码程序。
用ASP输出九九乘法口决表的网页
输出如下:
1*1=1
1*2=2 2*2=4
1*3=3 2*3=6 3*3=9
请写出完整的ASP代码程序。
参考答案如下:
方法1:

九九乘法表


<%for i= 1 to 9%>

<%for j= 1 to i%>

<%for k=i+1 to 9%>


<%next%>

<%=j&”*”&i&”=”&j*i%>
<%next%>

<%=” “%>
<%next%>


方法2:
<%
dim a,b
a=1
while a<=9
for b=a to 9
response.Write cstr(a)&”*”&cstr(b)&”=”&cstr(a*b)&”"
next
response.Write”

a=a+1
wend
%>
方法3:
<%for i=1 to 9%>
<%for j=1 to i%>
<%if j*i<10 then
response.write j&”*”&i&”=”&j*i&” “&” ”
else
response.write j&”*”&i&”=”&j*i&” ”
end if
%>
<%next%>
<%=”
”%>
<%for k=i+1 to 9%>
<%=” “%>
<%next%>
<%next%>
词条:aspnet面试题
上一篇:南京华招网笔试题 下一篇:ASP.NET中内置对象是什么
与该文相关的文章

温馨提示:如果您对面试网有任何建议,请通过网站联系邮箱向我们反馈,感谢各位的建议与支持!