洛谷 P5732 【深基5.习7】杨辉三角
更多...
#include <luogu.h>
|
static int | main (istream &cin, ostream &cout) |
|
洛谷 P5732 【深基5.习7】杨辉三角
在文件 luogu.h 第 462 行定义.
◆ main()
int luogu::P5732::main |
( |
istream & |
cin, |
|
|
ostream & |
cout |
|
) |
| |
|
static |
在文件 luogu.cpp 第 1552 行定义.
1555 auto *triangle =
new int *[n];
1556 for(
int i = 0; i < n; i++) {
1557 triangle[i] =
new int[i + 1];
1558 for(
int j = 0; j <= i; j++) {
1559 if(j == 0 || j == i) {
1562 triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
1564 cout << triangle[i][j] <<
" ";
1568 for(
int i = 0; i < n; i++) {
1569 delete[] triangle[i];
被这些函数引用 luogu::TEST().
该类的文档由以下文件生成: