#include int main() { int n, m; scanf("%d", &n); scanf("%d", &m); int map[n][m]; int i, j, p, q; int x, sum = 0, top=0; int res[(n*m)][2]; // (n*m) / 2 也可以 for (i = 0; i < n; i++){ for (j = 0; j < m; j++){ scanf("%d", &map[i][j]); } } for (i = 0; i < n; i++){ for (j = 0; j < m; j++){ x = map[i][j]; for (p = 0; p < n; p++){ for (q = 0; q < m; q++){ if (abs(i - p) + abs(j - q) < x || abs(i - p) + abs(j - q) == x){ sum += map[p][q]; } } } //printf("sum = %d\n", sum); if (sum % 10 == x){ res[top][0] = i; res[top][1] = j; top++; } sum = 0; } } printf("%d\n", top); for (i = 0; i < top; i++){ printf("%d ", res[i][0]); printf("%d\n", res[i][1]); } }