Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int A[9];
	int chk[9];
	for(int i=0;i<9;i++){
		cin >> A[i];
		chk[i] = 0;
	}
	int N;
	cin >> N;
	int b[N];
	for(int i=0;i<N;i++){
		cin >> b[i];
		for(int j=0;j<9;j++){
			if(A[i] == b[j]) chk++;
		}
	}
	int ans = "No";
	if(chk[0] > 0 && chk[1] > 0 && chk[2] > 0)ans = "Yes";
	if(chk[3] > 0 && chk[4] > 0 && chk[5] > 0)ans = "Yes";
	if(chk[6] > 0 && chk[7] > 0 && chk[8] > 0)ans = "Yes";
	if(chk[0] > 0 && chk[3] > 0 && chk[6] > 0)ans = "Yes";
	if(chk[1] > 0 && chk[4] > 0 && chk[7] > 0)ans = "Yes";
	if(chk[2] > 0 && chk[5] > 0 && chk[8] > 0)ans = "Yes";
	if(chk[0] > 0 && chk[4] > 0 && chk[8] > 0)ans = "Yes";
	if(chk[2] > 0 && chk[4] > 0 && chk[6] > 0)ans = "Yes";
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: lvalue required as increment operand
   17 |                         if(A[i] == b[j]) chk++;
      |                                          ^~~
a.cc:20:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   20 |         int ans = "No";
      |                   ^~~~
      |                   |
      |                   const char*
a.cc:21:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   21 |         if(chk[0] > 0 && chk[1] > 0 && chk[2] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:22:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   22 |         if(chk[3] > 0 && chk[4] > 0 && chk[5] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:23:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   23 |         if(chk[6] > 0 && chk[7] > 0 && chk[8] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:24:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   24 |         if(chk[0] > 0 && chk[3] > 0 && chk[6] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:25:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   25 |         if(chk[1] > 0 && chk[4] > 0 && chk[7] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:26:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   26 |         if(chk[2] > 0 && chk[5] > 0 && chk[8] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:27:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   27 |         if(chk[0] > 0 && chk[4] > 0 && chk[8] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*
a.cc:28:57: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   28 |         if(chk[2] > 0 && chk[4] > 0 && chk[6] > 0)ans = "Yes";
      |                                                         ^~~~~
      |                                                         |
      |                                                         const char*