输出杨辉三角形的C++程序中,横线处应填入哪项代码
下列程序实现了输出杨辉三角形,代码中横线部分应该填入的是( )。
#include <iostream>
using namespace std;
#define N 35
int a[N];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
a[i] = 1;
for (int j = i - 1; j > 0; j--)
________; // 在此处填入选项
for (int j = 0; j <= i; j++)
cout << a[j] << " ";
cout << endl;
}
return 0;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析