Hello. I can not get the program to show the saddle point:
#include <stdio.h>
int main() {
int matriz [100][100],maior,menor;
for(int i = 0;i < 3;i++){
for(int j = 0;j < 3;j++){
scanf("%d",&matriz[i][j]);
}
}
for(int i = 0;i < 3;i++){
maior = matriz[i][0];
for(int j = 0;j < 3;j++){
if(maior > matriz[i][j]){
maior = matriz[i][j];
}
menor = matriz[0][j];
for(int k = 0;k < 3;k++){
if(menor < matriz[k][j]){
menor = matriz[k][j];
}
if(menor == maior){
printf("%d\n",matriz[i][j]);
}
}
printf("\n");
}
}
return 0;
}
In the statement it asks for this:
Your program should read a 3x3 array of integers and print the saddle points in ascending order. There are at most 2 saddle stitches per die.
I can not make the program show the saddle point.