题解 1231: 杨辉三角

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

杨辉三角-题解(C++代码)

解题思路:思路很一般,利用二位数组来存储三角阵。利用两个嵌套的for循环就可以将整个三角阵输入到二位数组中,在二维数组的逐层输入的过程中。先判断本层数组的首尾,给本层数组的首尾都赋值为1,然后再对本层数组的其他位置赋值,赋值为上一层数组中与该位置先后位置的两个数组和,

1231: 杨辉三角

摘要:```cpp #include using namespace std; int main() { int n,a[30][30]; while(cin>>n) ……

1231: 杨辉三角

```#includeusingnamespacestd;constintN=110;inta[N][N];intmain(){intn;while(cin>>n){a[1][1]=1;cout

最直观的解法

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { int n; // 多组输入……

1231基础解法(Python)

摘要:解题思路:没啥思路注意事项:注意print()才是空一行,print(&#39;\n&#39;)是空两行参考代码:lst_rec = list(map(int, input().split()))fo……

编写题解 1231: 杨辉三角

摘要:解题思路:注意事项:参考代码:#include "stdio.h" int main() {   int n, i, j;   int a[30][30];   while (scanf("%……

杨辉三角解题

摘要:解题思路:注意事项:参考代码:while True:    try:        def tri(row):            List = [[1 for i in range(j)] for……

一维数组的解法

摘要:```cpp#includeusing namespace std;int main(){ int a; while(cin >> a) { ……

杨辉三角(Java)

摘要:解题思路:注意事项:参考代码:package arrLast; //题目 1231: 杨辉三角 import java.util.Scanner; public class t_1231 { ……