Home > Back-end >  Calculate each line element and its largest in line and column number, what is going wrong, a great
Calculate each line element and its largest in line and column number, what is going wrong, a great

Time:09-20



# include "stdio.h"
Void main ()
{
Int I, j, Max, m, n;
Int a [3] [4].
for(i=0; i<3; I++)
for(j=0; J<4. J++)
The scanf (" % d ", & amp; A [I] [j]);

for(i=0; i<3; I++)
{
for(j=0; J<4. J++)
Printf (" % 4 d ", a [I] [j]);
printf("\n");
}

for(i=0; i<3; I++)
{
Max=a, [I] [0].

{the for (j=0; J<4. J++) {if (max
Printf (" % d line biggest elements don't ranks number is % d, % d \ n ", I + 1, m + 1, n + 1);
}
}

}


CodePudding user response:

Code indentation is a good habit,
 
for(i=0; i<3; I++)
{
Max=a, [I] [0].

{the for (j=0; J<4. J++)
{
If (max
{
Max=a, [I] [j].
m=i;
N=j;
}
}
Printf (" % d line biggest elements don't ranks number is % d, % d \ n ", I + 1, m + 1, n + 1);

}

Such levels more clear, the m=I; N=j is also included in the statement give it a try

CodePudding user response:

reference 1st floor CHXCHXKKK response:
code indentation is a good habit,
 
for(i=0; i<3; I++)
{
Max=a, [I] [0].

for(j=0; J<4. J++)//above a {
{
If (max
{
Max=a, [I] [j].
m=i;
N=j;
}
}
Printf (" % d line biggest elements don't ranks number is % d, % d \ n ", I + 1, m + 1, n + 1);

}

Such levels more clear, the m=I; N=j is also included in the statement try

More than a {

CodePudding user response:

//# include "stdio.h" 
#include

//void main ()
Int main ()
{
Int I, j, Max, m, n;
Int a [3] [4].

for(i=0; i<3; I++)
for(j=0; J<4. J++)
The scanf (" % d ", & amp; A [I] [j]);

for(i=0; i<3; I++)
{
for(j=0; J<4. J++)
Printf (" % 4 d ", a [I] [j]);
printf("\n");
}

for(i=0; i<3; I++)
{
Max=a, [I] [0].

{
//for (j=0; J<4. J++) {
for(j=1; J<4. J++) {
If (max
Max=a, [I] [j].
m=i;
N=j;
}
//m=I;
//n=j;
}

Printf (" % d line biggest elements don't ranks number is % d, % d \ n ", I + 1, m + 1, n + 1);
}
}

}

For your reference ~
  • Related