| 关于ASP中FOR循环的小应用 |
|
作者:佚名 文章来源:不详 点击数: 更新时间:2008-3-18 23:01:49  |
|
今天一大学同学突然问我一编程问题,让我用ASP帮她编写输出一如下图形:
* *** ***** *******
一时间我还想不起该怎么回答了,相当惭愧。研究了半天才写出来了,感觉相当丢人。代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head>
<body> <% dim n,i,a,b for n=1 to 7 step 2 i = 0 a = 0 b = (7 - n)/2 for a = 1 to b response.write " " next for i = 1 to n response.write "*" next response.write "<br>" next %> </body> </html>
本文章出自Shuro's Blog(http://www.shuro.cn),转载请注明出处,谢谢!
|
| 文章录入:admin 责任编辑:admin |
|
上一篇文章: 健康学琴 快乐成长 下一篇文章: 大龄青年的钢琴梦 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |