主题:杨辉三角形怎么打 求教
周寅张皓
[专家分:50] 发布于 2010-07-27 19:35:00
老师在课堂上布置了杨辉三角形作业,不会.....
求求大家看看,知道的教教我,谢谢[em17]
回复列表 (共13个回复)
11 楼
verysmartboy [专家分:1260] 发布于 2010-10-25 20:59:00
cls
dim a(10,10)
for i=1 to 10
for j=1 to 10
print "书上p142有"
next j
next i
end
12 楼
幽灵密码 [专家分:3510] 发布于 2010-11-27 13:47:00
CLS
DO UNTIL n > 0 AND n < 13
INPUT n
LOOP
FOR i = 0 TO n
a = 1
FOR j = 1 TO i + 1
PRINT TAB(n * 3 - 5 - i * 3 + j * 6); a;
a = a * (i - j + 1) / j
NEXT j
PRINT
NEXT i
END
13 楼
rightnow [专家分:0] 发布于 2010-11-27 18:00:00
CLS
DO
INPUT n
LOOP UNTIL n < 14
FOR i = 0 TO n - 1
a = 1
FOR j = 1 TO i + 1
PRINT TAB(32 - i * 3 + j * 6); a;
a = a * (i - j + 1) / j
NEXT j
PRINT
NEXT i
END
我来回复