You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
511 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 50;
long long a[N][N];
int main()
{
a[0][0] = 1;
int n = 30;
for (int i = 1; i < n; i++)
for (int j = 1; j <= i; j++)
a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
for (int i = 1; i < n; i++, putchar('\n'))
for (int j = 1; j <= i; j++, putchar(' '))
printf("%8lld", a[i][j]);
return 0;
}