设为首页 加入收藏

TOP

用ASP输出九九乘法口决表的网页
2014-11-03 14:15:04 来源: 作者: 【 】 浏览:22
Tags: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%>


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇外企招聘程序 下一篇伟易达笔试题–C++笔试及上机题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: