PS: You can submit program 1 with G ++, but you cannot submit program 2 with GCC. The difference between program 1 and Program 2 is to change the absolute value function fabs () to abs (). (If the gods know, explain the reasons. Thank you !)
Procedure 1:
[Plain] # include <stdio. h>
# Include <math. h>
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int x;
Int y;
Int max;
Int num [101] [101];
While (scanf ("% d", & n, & m )! = EOF)
{
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
Scanf ("% d", & num [I] [j]);
}
}
X = y = 0;
Max = 0;
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
If (fabs (num [I] [j])> fabs (max) // use fabs ()
{
Max = num [I] [j];
X = I;
Y = j;
}
}
}
Printf ("% d \ n", x + 1, y + 1, max );
}
Return 0;
}
# Include <stdio. h>
# Include <math. h>
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int x;
Int y;
Int max;
Int num [101] [101];
While (scanf ("% d", & n, & m )! = EOF)
{
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
Scanf ("% d", & num [I] [j]);
}
}
X = y = 0;
Max = 0;
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
If (fabs (num [I] [j])> fabs (max) // use fabs ()
{
Max = num [I] [j];
X = I;
Y = j;
}
}
}
Printf ("% d \ n", x + 1, y + 1, max );
}
Return 0;
}
Procedure 2:
[Plain] # include <stdio. h>
# Include <math. h>
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int x;
Int y;
Int max;
Int num [101] [101];
While (scanf ("% d", & n, & m )! = EOF)
{
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
Scanf ("% d", & num [I] [j]);
}
}
X = y = 0;
Max = 0;
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
If (abs (num [I] [j])> abs (max) // abs () is used ()
{
Max = num [I] [j];
X = I;
Y = j;
}
}
}
Printf ("% d \ n", x + 1, y + 1, max );
}
Return 0;
}
# Include <stdio. h>
# Include <math. h>
Int main ()
{
Int I;
Int j;
Int n;
Int m;
Int x;
Int y;
Int max;
Int num [101] [101];
While (scanf ("% d", & n, & m )! = EOF)
{
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
Scanf ("% d", & num [I] [j]);
}
}
X = y = 0;
Max = 0;
For (I = 0; I <n; I ++)
{
For (j = 0; j <m; j ++)
{
If (abs (num [I] [j])> abs (max) // abs () is used ()
{
Max = num [I] [j];
X = I;
Y = j;
}
}
}
Printf ("% d \ n", x + 1, y + 1, max );
}
Return 0;
}