1个回答
2013-07-07
展开全部
INPUT "N="; n
Dim a(n, n)
FOR j = 1 TO n
a(j, j) = 1
a(j, 1) = 1
FOR k = 2 TO j - 1
a(j, k) = a(j - 1, k - 1) + a(j - 1, k)
NEXT k
NEXT j
FOR j = 1 TO n
FOR k = 1 TO j
PRINT TAB(5 * k); a(j, k);
NEXT k
Print
NEXT j 试一下吧!
Dim a(n, n)
FOR j = 1 TO n
a(j, j) = 1
a(j, 1) = 1
FOR k = 2 TO j - 1
a(j, k) = a(j - 1, k - 1) + a(j - 1, k)
NEXT k
NEXT j
FOR j = 1 TO n
FOR k = 1 TO j
PRINT TAB(5 * k); a(j, k);
NEXT k
NEXT j 试一下吧!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询