Home > Back-end >  A two dimensional array maximum problem, consult bosses to reassure
A two dimensional array maximum problem, consult bosses to reassure

Time:09-22

Just learning c + +, a two dimensional array and outputs, the maximum of line and column number of the programming and there was no difference on the textbooks, in the input data after the result is not correct, somehow, consult everybody bosses:
This is the source code:
# include
Using namespace STD.
Int main () {
Int I, j, row, colom, Max.
Int a [3] [4].
for(i=0; i<3; I++)
for(j=0; j<4. J++)
Cin> A [3] [4].

Max=a [0] [0];
The row=0, colom=0;
for(i=0; i<3; I++)
for(j=0; j<4. J++)
If (max{Max=a, [I] [j].
The row=I; Colom=j;
}
cout<" \ nmax="& lt; return 0;
}
The following is the result of output:

CodePudding user response:

# include
Using namespace STD.
Int main () {
Int I, j, row, colom, Max.
Int a [3] [4].
for(i=0; i<3; I++)
for(j=0; j<4. J++)
Cin> A, [I] [j].

Max=0;
The row=0, colom=0;
for(i=0; i<3; I++)
{
for(j=0; j<4. J++)
{
If (max
{
Max=a, [I] [j].
The row=I;
Colom=j;
}
}
}
cout<" \ nmax="& lt; return 0;
}

CodePudding user response:

Cin> A [3] [4].=="" a [I] [j].
  • Related