Question # include <iostream> # include <cstring> # include <cmath> using namespace STD; int Ki [23] [23]; int value [23] [23]; int n, m; int cal_val (int x, int y) {If (x * Y <0) return ABS (y); else if (x * Y> 0) return-ABS (y); elsereturn 0;} int main () {While (CIN> N> m) {If (n = 0 & M = 0) break; memset (value, 0, sizeof (value); memset (KI, 0, sizeof (Ki); For (INT I = 1; I <= N; I ++) {for (Int J = 1; j <= m; j ++) {CIN> Ki [I] [J]; value [I] [J] = 0 ;}for (INT I = 1; I <= N; I ++) {for (Int J = 1; j <= m; j ++) {value [I] [J] + = cal_val (KI [I] [J], Ki [I-1] [J]); value [I] [J] + = cal_val (KI [I] [J], Ki [I + 1] [J]); value [I] [J] + = cal_val (KI [I] [J], Ki [I] [J-1]); value [I] [J] + = cal_val (KI [I] [J], Ki [I] [J + 1]) ;}} int MX = 1, my = 1; int max = value [1] [1]; for (INT I = 1; I <= N; I ++) {for (Int J = 1; j <= m; j ++) {If (value [I] [J]> MAX) {max = value [I] [J]; MX = I; my = J ;}}cout <MX <"" <my <"" <value [MX] [my] <Endl ;}return 0 ;}