#include
int main() { int numRows;
cout << "Enter the number of rows for Pascal's Triangle: ";
cin >> numRows;
int triangle[numRows][numRows];
for (int i = 0; i < numRows; i++) {
triangle[i][0] = 1;
triangle[i][i] = 1;
}
for (int i = 2; i < numRows; i++) {
for (int j = 1; j < i; j++) {
triangle[i][j] = triangle[i-1][j-1] + triangle[i-1][j];
}
}
cout << "Pascal's Triangle:" << endl;
for (int i = 0; i < numRows; i++) {
for (int j = 0; j <= i; j++) {
cout << triangle[i][j] << " ";
}
cout << endl;
}
return 0;
}