Untitled

public
yousefkarem91 Sep 22, 2024 Never 73
Clone
C++ paste1.cpp 17 lines (16 loc) | 341 Bytes
1
#include <bits/stdc++.h>
2
using namespace std;
3
4
int main() {
5
int n;cin>>n;
6
int arr[n][n];
7
for(int i=0;i<n;i++) {
8
arr[0][i]=1;
9
arr[i][0]=1;
10
}
11
for(int i=1;i<n;i++) {
12
for(int j=1;j<n;j++) {
13
arr[i][j]=arr[i-1][j]+arr[i][j-1];
14
}
15
}
16
cout<<arr[n-1][n-1]<<'\n';
17
}