vfp编写程序用“*”打印一个金字塔型的图形:第一行一个星,第二行三个星,第三行五个星,最后一行13个星

来源:百度知道 编辑:UC知道 时间:2024/05/15 07:20:17
马上要交作业了 谢谢大家!

clear
for i=1 to 7
mm=space(8-i)
mm1=""
for j=1 to 2*i-1
mm1=mm1+'*'
endf
? mm+mm1
endf
wait
retu

*3行语句就解决了,如下

for a=1 to 13 step 2
?space(13-a/2)+repl('*',a)
endfor

这个是思路,再不会没办法,不告诉你源码,自己去做。多多动手
for i=1 to 7
print 8-i 个空格 space(i)

print i*2-1个* string(i*2-1,"*")
next i