Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, a[20][20];
- void Rez()
- {
- for(int i = 1; i <= n; i++)
- a[i][1] = i,
- a[n][i] = n;
- for(int j = 2; j <= n; j++)
- for(int i = 1; i < n; i++)
- a[i][j] = a[i][j - 1] + a[i + 1][j - 1];
- for(int i = 1; i <= n; i++)
- {
- for(int j = 1; j <= n; j++) cout << a[i][j] << " ";
- cout << "\n";
- }
- }
- int main()
- {
- cin >> n;
- Rez();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement