int x = 1;
int y = 1;
int z = 1;
for (int i = 0; i < rows; i++){
for (int j = 0; j < cols + rows - 1; j++){
if ( i == j ){
x = x*d[i][j];
}
if (i+1 == j){
y = y*d[i][j];
}
if(i+2==j){
z=z*d[i][j];
}}}
cout << x + y + z;
1 2 3 4 5 6 7 8 9 10
int x = 1;
int x1 = 0;
for (int g = 0; g < rows -1; g++){
for (int i = 0; i < rows; i++){
for (int j = 0; j < cols + rows - 1; j++){
if ( i + g== j ){
x = x*d[i][j];
}
}}x1 = x1 + x;}
cout << x1;
int x = 1;
int y = 1;
int z = 1;
for ( int i = 0; i < rows-2; ++i ) {
x *= d[i][i];
y *= d[i][i+1];
z *= d[i][i+2];
}
x *= d[rows-2][rows-2];
y *= d[rows-2][rows-1];
x *= d[rows-1][rows-1];
cout << x + y + z;