文章浏览阅读4.9k次,点赞2次,收藏23次。object YangSan { def main(args: Array[String]): Unit = { val num = pascal() val Value = Array.ofDim[Int](num,num) for (i <- 0 until num) { //行 for (j <- 0 to i) { //列 if (j == 0 || j == i) Value(i)(j) = 1 e......
题目Given an integer numRows, return the first numRows of Pascal’s triangle.In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown:给定一个非负整数 numRows,生成「杨辉三角」的前 numRows 行。在「杨辉三角」中,每个数是它左......