您的位置:程序门 -> vb -> 基础类



求教扬辉三角程序


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


求教扬辉三角程序[已结贴,结贴人:yudi010]
发表于:2007-01-22 14:23:17 楼主
求教事例
发表于:2007-01-22 15:00:201楼 得分:10
程序员试题
private   sub   form_click()
dim   i,   j,   c   as   integer,   strtemp   as   string
dim   a(9)   as   integer
a(0)   =   0
a(1)   =   1
strtemp   =   str(a(1))   +   space(3)
currentx   =   (scalewidth   -   textwidth(strtemp))   /   2
print   strtemp
for   j   =   2   to   9
a(j)   =   1
for   c   =   j   -   1   to   2   step   -1
a(c)   =   a(c)   +   a(c   -   1)
next
strtemp   =   " "
for   c   =   1   to   j
strtemp   =   strtemp   &   str(a(c))   &   space(5   -   len(str(a(c))))
next
currentx   =   (scalewidth   -   textwidth(strtemp))   /   2
print   strtemp
next

end   sub



快速检索

最新资讯
热门点击