CodePudding user response:
Two-dimensional traversal, and the Max and min is not good,CodePudding user response:
# include & lt; Iostream>
using namespace std;
Int main ()
{
Int I, j, arr [5] [5]={0};
Int the Max and min.
cout <"Input matrix data:" & lt;for (i=0; I<5; I++)
{
For (j=0; J<5; J++)
{
cin> Arr [I] [j];
}
}
Max=min=arr [0] [0].
For (I=0; I & lt; 5; I++)
{
For (j=0; J & lt; 5; J++)
{
If (Max & lt; Arr [I] [j])
Max=arr [I] [j];
If (min & gt; Arr [I] [j])
Min=arr [I] [j];
}
}
cout <"A maximum matrix is:" & lt;
return 0;
}