current position:Home>Why can this code run but can't output anything?

Why can this code run but can't output anything?

2022-01-27 02:35:10 CSDN Q & A

The title is “ Find one 5 That's ok 4 Of a two-dimensional array of columns “ saddle point ”, That is, the element in this position is the smallest on this line , Maximum on this column . Output the value and row and column number of this element , If there is no saddle point , The output “ No saddle point found ”.”

#include<iostream>using namespace std;int main(){    int a[5][4],i,j;    void andian(int array[5][4]);    for(i=0;i<=4;i++)        for(j=0;j<=3;j++)            cin>>a[i][j];    andian(a);    return 0;}void andian(int array[5][4]){    int i,j;    int min(int,int,int,int);    int max(int,int,int,int,int);    for(i=0;i<=4;i++)        for(j=0;j<=3;j++)            if(array[i][j]==min(array[i][0],array[i][1],array[i][2],array[i][3])&&array[i][j]==max(array[0][j],array[1][j],array[2][j],array[3][j],array[4][j]))                cout<<i<<" "<<j<<endl;}int min(int a,int b,int c,int d){    int y=0;    if(a<y)y=a;    if(b<y)y=b;    if(c<y)y=c;    if(d<y)y=d;    return(y);}int max(int a,int b,int c,int d,int e){    int x=0;    if(a>x)x=a;    if(b>x)x=b;    if(c>x)x=c;    if(d>x)x=d;    if(e>x)x=d;    return(x);}
Input of operation results and error reports

No matter what you input, there is no output .

My solution ideas and tried methods
What I want to achieve

Refer to the answer 1:

int x=0;
Change it to x=a;
First, let x The value of is the first number , Otherwise, all numbers must be natural numbers , Can't judge negative numbers .
min The problem with functions is bigger , You just let y=0, If the data you enter is greater than 0, No matter how you calculate , The minimum value will be 0, Of course that can't be equal .

Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.

Random recommended