Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<tuple>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
#define MAX 510
int H, W, 
int a[MAX][MAX] = {}, temp[MAX][MAX] = {}, 
int cnt;
bool flag[MAX][MAX] = {};

signed main() {
	cin >> H >> W;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			cin >> a[i][j];
			temp[i][j] = a[i][j];
		}
	}
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			if (a[i][j] % 2 == 1 && j != W) { 
				a[i][j + 1]++, a[i][j]--; cnt++; 
			}
		}
		if (a[i][W] % 2 == 1 && i != H) {
			a[i + 1][W]++, a[i][W]--; cnt++; 
		}
	}
	cout << cnt << endl;;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			if (temp[i][j] % 2 == 1 && j != W) {
				temp[i][j + 1]++, temp[i][j]--;
				cout << i << " " << j << " " << i << " " << j + 1 << endl;
			}
		}
		if (temp[i][W] % 2 == 1 && i != H) {
			temp[i + 1][W]++, temp[i][W]--;
			cout << i << " " << W << " " << i + 1 << " " << W << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc:12:1: error: expected unqualified-id before 'int'
   12 | int a[MAX][MAX] = {}, temp[MAX][MAX] = {},
      | ^~~
a.cc:12:21: error: expected unqualified-id before ',' token
   12 | int a[MAX][MAX] = {}, temp[MAX][MAX] = {},
      |                     ^
a.cc:12:38: error: expected constructor, destructor, or type conversion before '=' token
   12 | int a[MAX][MAX] = {}, temp[MAX][MAX] = {},
      |                                      ^
a.cc:12:42: error: expected unqualified-id before ',' token
   12 | int a[MAX][MAX] = {}, temp[MAX][MAX] = {},
      |                                          ^
a.cc:13:1: error: expected unqualified-id before 'int'
   13 | int cnt;
      | ^~~
a.cc: In function 'int main()':
a.cc:20:32: error: 'a' was not declared in this scope
   20 |                         cin >> a[i][j];
      |                                ^
a.cc:21:25: error: 'temp' was not declared in this scope; did you mean 'tm'?
   21 |                         temp[i][j] = a[i][j];
      |                         ^~~~
      |                         tm
a.cc:26:29: error: 'a' was not declared in this scope
   26 |                         if (a[i][j] % 2 == 1 && j != W) {
      |                             ^
a.cc:27:59: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |                                 a[i][j + 1]++, a[i][j]--; cnt++;
      |                                                           ^~~
      |                                                           int
a.cc:30:21: error: 'a' was not declared in this scope
   30 |                 if (a[i][W] % 2 == 1 && i != H) {
      |                     ^
a.cc:31:51: error: 'cnt' was not declared in this scope; did you mean 'int'?
   31 |                         a[i + 1][W]++, a[i][W]--; cnt++;
      |                                                   ^~~
      |                                                   int
a.cc:34:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   34 |         cout << cnt << endl;;
      |                 ^~~
      |                 int
a.cc:37:29: error: 'temp' was not declared in this scope; did you mean 'tm'?
   37 |                         if (temp[i][j] % 2 == 1 && j != W) {
      |                             ^~~~
      |                             tm
a.cc:42:21: error: 'temp' was not declared in this scope; did you mean 'tm'?
   42 |                 if (temp[i][W] % 2 == 1 && i != H) {
      |                     ^~~~
      |                     tm