criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;


 int N;
 int S[100000]
 int q;
 int T[1000];
 int count;

 int main(){
 	cin >> N;
 	for(int i = 0; i < N; i++){
 		cin >> S[i];
 	}
 	cin >> q;
 	for(int j = 0; j < q; j++){
 		cin >> T[j];
 	}

 	for(int j = 0; j < q; j++){
 		for(int i = 0; i < N; i++){
 			if(S[i] == T[j]) count++;
 		}
 	}

 	cout << count << endl;

 	return 0;
 }

Compiler output:
a.cc:11:2: error: expected initializer before 'int'
   11 |  int q;
      |  ^~~
a.cc: In function 'int main()':
a.cc:18:24: error: 'S' was not declared in this scope
   18 |                 cin >> S[i];
      |                        ^
a.cc:20:16: error: 'q' was not declared in this scope
   20 |         cin >> q;
      |                ^
a.cc:27:28: error: 'S' was not declared in this scope
   27 |                         if(S[i] == T[j]) count++;
      |                            ^
a.cc:27:42: error: reference to 'count' is ambiguous
   27 |                         if(S[i] == T[j]) count++;
      |                                          ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count;
      |      ^~~~~
a.cc:31:17: error: reference to 'count' is ambiguous
   31 |         cout << count << endl;
      |                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count;
      |      ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;


 int N;
 int S[100000];
 int q;
 int T[1000];
 int count;

 int main(){
 	cin >> N;
 	for(int i = 0; i < N; i++){
 		cin >> S[i];
 	}
 	cin >> q;
 	for(int j = 0; j < q; j++){
 		cin >> T[j];
 	}

 	for(int j = 0; j < q; j++){
 		for(int i = 0; i < N; i++){
 			if(S[i] == T[j]) count++;
 		}
 	}

 	cout << count << endl;

 	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:27:42: error: reference to 'count' is ambiguous
   27 |                         if(S[i] == T[j]) count++;
      |                                          ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count;
      |      ^~~~~
a.cc:31:17: error: reference to 'count' is ambiguous
   31 |         cout << count << endl;
      |                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count;
      |      ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;


 int N;
 int S[100000];
 int q;
 int T[1000];
 int count = 0;

 int main(){
 	cin >> N;
 	for(int i = 0; i < N; i++){
 		cin >> S[i];
 	}
 	cin >> q;
 	for(int j = 0; j < q; j++){
 		cin >> T[j];
 	}

 	for(int j = 0; j < q; j++){
 		for(int i = 0; i < N; i++){
 			if(S[i] == T[j]) count++;
 		}
 	}

 	cout << count << endl;

 	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:27:42: error: reference to 'count' is ambiguous
   27 |                         if(S[i] == T[j]) count++;
      |                                          ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count = 0;
      |      ^~~~~
a.cc:31:17: error: reference to 'count' is ambiguous
   31 |         cout << count << endl;
      |                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:13:6: note:                 'int count'
   13 |  int count = 0;
      |      ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;


 
 int main(){
 	int N;
 	int S[100000];
 	int q;
 	int T[1000];
 	int count = 0;

 	cin >> N;
 	for(int i = 0; i < N; i++){
 		cin >> S[i];
 	}
 	cin >> q;
 	for(int j = 0; j < q; j++){
 		cin >> T[j];
 	}

 	for(int i = 0; i < q; i++){
 		int j = 0;
 		while(T[i] != S[j]) j++;
 		if(j == N+1)
 		else{count++;}
 	}

 	cout << count << endl;

 	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: expected primary-expression before 'else'
   30 |                 else{count++;}
      |                 ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace  std;

void fnInput(vector<int> &a_rvoTarget, vector<int> &a_rvoSearch)
{
  ifstream fin( FILENAME.c_str() );
  int iTargetCnt;
  cin >> iTargetCnt;

  for (int i = 0; i < iTargetCnt; i++)
  {
    int iTarget;
    cin >> iTarget;
    a_rvoTarget.push_back(iTarget);
  }

  int iSearchCnt;
  cin >> iSearchCnt;

  for (int i = 0; i < iSearchCnt; i++)
  {
    int iSearch;
    cin >> iSearch;
    a_rvoSearch.push_back(iSearch);
  }
}

void fnLinearSearch(const vector<int> &a_cnrvoTarget, const vector<int> &a_cnrvoSearch, int &a_riFound)
{
  for (auto itvoSearch = begin(a_cnrvoSearch); itvoSearch != end(a_cnrvoSearch); itvoSearch++)
    for (auto itvoTarget = begin(a_cnrvoTarget); itvoTarget != end(a_cnrvoTarget); itvoTarget++)
      if (*itvoTarget == *itvoSearch)
      {
        a_riFound++;
        break;
      }
}

void fnResultOut(int a_iFound)
{
  cout << a_iFound << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  vector<int> voTarget, voSearch;
  int iFound = 0;

  fnInput(voTarget, voSearch);
  fnLinearSearch(voTarget, voSearch, iFound);
  fnResultOut(iFound);

  return 0;
}

Compiler output:
a.cc: In function 'void fnInput(std::vector<int>&, std::vector<int>&)':
a.cc:7:17: error: variable 'std::ifstream fin' has initializer but incomplete type
    7 |   ifstream fin( FILENAME.c_str() );
      |                 ^~~~~~~~
a.cc:3:1: note: 'std::ifstream' is defined in header '<fstream>'; this is probably fixable by adding '#include <fstream>'
    2 | #include <vector>
  +++ |+#include <fstream>
    3 | using namespace  std;
a.cc:7:17: error: 'FILENAME' was not declared in this scope
    7 |   ifstream fin( FILENAME.c_str() );
      |                 ^~~~~~~~
Language: C++

import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Arrays;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int ans=0;
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st1=new StringTokenizer(br.readLine);
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st1.nextToken());
int m=Integer.parseInt(br.readLine());
StringTokenizer st2=new StringTokenizer(br.readLine);
for(int i=0;i<m;i++){
int b=Integer.parseInt(st2.nextToken());
if(Arrays.asList(a).contains(b)) ans++;
}
out.println(ans);
out.flush();
}
}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.ArrayList;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Arrays;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:8: error: 'final' does not name a type
    8 | static final PrintWriter out=new PrintWriter(System.out);
      |        ^~~~~
a.cc:10:7: error: expected ':' before 'static'
   10 | public static void main(String[] args) throws IOException{
      |       ^~~~~~~
      |       :
a.cc:10:25: error: 'String' has not been declared
   10 | public static void main(String[] args) throws IOException{
      |                         ^~~~~~
a.cc:10:34: error: expected ',' or '...' before 'args'
   10 | public static void main(String[] args) throws IOException{
      |                                  ^~~~
a.cc:10:38: error: expected ';' at end of member declaration
   10 | public static void main(String[] args) throws IOException{
      |                                      ^
      |                                       ;
a.cc:10:40: error: 'throws' does not name a type
   10 | public static void main(String[] args) throws IOException{
      |                                        ^~~~~~
a.cc:29:2: error: expected ';' after class definition
   29 | }
      |  ^
      |  ;
Language: C++



#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,q;

  cin >> n;
  int S[n];
  for(int i = 0; i<n; i++){
    cin >> S[i];
  }
  sort(S, S+n);
  for(int i)

  cin >> q;
  int T[q];
  for(int i = 0; i<q; i++){
    cin >> T[i];
  }
  //sort(T,T+q);

  int answer = 0;
  for (size_t i = 0; i < n; i++) {
    for (size_t j = 0; j < q; j++) {
        if(S[i] == T[j]){
          answer++;
          break;
        }
    }
  }
  cout  << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before ')' token
   15 |   for(int i)
      |            ^
      |            ;
a.cc:15:12: error: expected primary-expression before ')' token
a.cc:15:12: error: expected ';' before ')' token
   15 |   for(int i)
      |            ^
      |            ;
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>

using namespace std;

class cLSearch
{
	int mn, mq;
	string mS, mT;
	vector<int> vs, vt;
	int ans;

	void cLSearch::decode();
public:
	cLSearch(int &n, int &q, string &s, string &t)
	{
		mn = n;
		mq = q;
		mS = s;
		mT = t;

		decode();
	}

	void search();
	void output();
};

void cLSearch::search()
{
	int count = 0;
	for (int i = 0; i < mn; ++i)
	{
		for (int j = 0; j < mq; ++j)

		{
			if (vs[i] == vt[j])
			{
				++count;
			}
		}
	}
	ans = count;
}

void cLSearch::output()
{
	cout << ans << endl;
}
void cLSearch::decode()
{
	istringstream iss;
	iss.str(mS);
	int ts;
	for (int i = 0; i < mn; ++i)
	{
		iss >> ts;
		vs.push_back(ts);
	}
	iss.str(mT);
	iss.seekg(0, iss.beg);
	for (int i = 0; i < mq; ++i)
	{
		iss >> ts;
		vt.push_back(ts);
	}
}

int main()
{
	fin.tie(0);
	ios::sync_with_stdio(false);

	int n, q;
	string s, t;
	cin >> n;
	cin.ignore();
	getline(cin, s);
	cin >> q;
	cin.ignore();
	getline(cin, t);

	cLSearch cls(n, q, s, t);
	cls.search();
	cls.output();

	return 0;
}

Compiler output:
a.cc:23:14: error: extra qualification 'cLSearch::' on member 'decode' [-fpermissive]
   23 |         void cLSearch::decode();
      |              ^~~~~~~~
a.cc: In function 'int main()':
a.cc:81:9: error: 'fin' was not declared in this scope; did you mean 'sin'?
   81 |         fin.tie(0);
      |         ^~~
      |         sin
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	
	int i,j,n,q;
	int count=0;
	
	cin >> n;
	int<vector> S(n);
	for (i=0;i<n;i++){
		cin >> S[i];
	}
	cin >> q;
	int T[q];
	for (i=0;i<q;i++){
		cin >> T[i];
	}
	
	for (j=0;j<q;j++){
		for (i=0;i<n;i++){
			if(S[i]==T[j]){
				count++;
				break;
			}
		}
	}
	
	cout << count << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'int' is not a template
   12 |         int<vector> S(n);
      |         ^~~
a.cc:14:25: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> S[i];
      |                         ^
a.cc:24:29: error: invalid types 'int[int]' for array subscript
   24 |                         if(S[i]==T[j]){
      |                             ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

template <typename T, typename Alloc,
          template <typename _1, typename _2> class Container>
ostream& operator<<(ostream& os, const Container<T, Alloc >& p) {
    typename Container<T, Alloc>::const_iterator e = p.end();
    for (typename Container<T, Alloc>::const_iterator it = p.begin(); it != e;) {
        os << *it;
        os << (++it == e ? "" : " ");
    }
    return os;
}

int main(void){
  int n, q, cnt = 0;
  vector<int> S;
  
  cin >> n;
  for (auto i = 0; i < n; i++) S.push_back([]{int v; cin >> v; return v; }());
  
  cin >> q;
  for (auto i = 0; i < q; i++) {
    int v;
    cin >> v;
    if (find(S.begin(), S.end(), v) != S.end()) cnt++;
  }
  
  cout << cnt << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   27 |     if (find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:27:13: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   27 |     if (find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(void){
  int n, q, cnt = 0;
  vector<int> S;
  
  cin >> n;
  for (auto i = 0; i < n; i++) S.push_back([]{int v; cin >> v; return v; }());
  
  cin >> q;
  for (auto i = 0; i < q; i++) {
    int v;
    cin >> v;
    if (find(S.begin(), S.end(), v) != S.end()) cnt++;
  }
  
  cout << cnt << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   16 |     if (find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:16:13: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |     if (find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

int main(void){
  int n, q, cnt = 0;
  std::vector<int> S;
  
  std::cin >> n;
  for (int i = 0; i < n; i++) S.push_back([]{int v; std::cin >> v; return v; }());
  
  std::cin >> q;
  for (int i = 0; i < q; i++) {
    int v;
    std::cin >> v;
    if (std::find(S.begin(), S.end(), v) != S.end()) cnt++;
  }
  
  std::cout << cnt << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   15 |     if (std::find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:15:18: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   15 |     if (std::find(S.begin(), S.end(), v) != S.end()) cnt++;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#define N 10000
#define Q 500

int Search(int,int);
int i,j,d[];

int main(){
  int n,q,count=0;
  int S[N],T[Q];

 
  scanf("%d",&n);
  
  for(i=0 ; i<n ; i++){
    scanf("%d",&S[i]);
  }

  
  scanf("%d",&q);
  

  for(i=0 ; i<q ;i++){
    scanf("%d",&T[i]);
    for(j=0 ; j<n ; j++){
      count += Search(S[i],T[j]);
      break;
    }
  }
  printf("%d\n",count);

  return 0;
}

  int Search(int S,int T){
    if(S==T) return 1;
    return 0;
  }

Compiler output:
a.cc:6:9: error: storage size of 'd' isn't known
    6 | int i,j,d[];
      |         ^
Language: C++

#include<iostream>
using namespace std;
const int NOT_FOUND=-1;
int linearSearch(int key,int A[],int n){
	int i=0;
	A[n]=key;
	while(A[i]!=key){
		i++;
	}
	if(i==n){
		return NOT_FOUND;
	}
	else{
		return i;
	}
}
int main(){

	int n,s;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	cin>>s;
	int b[s];
	for(int i=0;i<s;i++){
		cin>>b[i];
	}
	
	int count=0;
	for(int i=0;i<n;i++){
		if(linearSearch(T[i],S,n)!=NOT_FOUND)count++;
	}
	cout<<count<<endl;
	
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:33: error: 'T' was not declared in this scope
   33 |                 if(linearSearch(T[i],S,n)!=NOT_FOUND)count++;
      |                                 ^
a.cc:33:38: error: 'S' was not declared in this scope
   33 |                 if(linearSearch(T[i],S,n)!=NOT_FOUND)count++;
      |                                      ^
Language: C++

#include<cstdio>

int main() {
	int n1, n2, t, cnt = 0;
	scanf("%d", &n1);
	int A[n1];
	for (int i = 0; i < n1; i++) {
		scanf("%d", &A[i]);
	}

	scanf("%d", &n2);
	for (int i = 0; i < n2; i++) {
		scanf("%d", &t);
		for (int j = 0; j < n1; j++) {
			if (t == A[j]) {
                            cnt += 1;
                            break;
		}
	}
	printf("%d\n", cnt);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(void)
{
	int n, q, S[10000],T[500],count = 0;
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &S[i]);
	}
	scanf_s("%d", &q);
	for (int i = 0; i < q; i++) {
		scanf_s("%d", &T[i]);
	}
	for (int i = 0; i < q; i++) {
		for (int j = 0; j < n; j++) {
			if (S[j] == T[i]) {
				count++; break;
			}
		}
	}
	printf("%d\n", count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <math.h>
int main(void)
{
	int n, q, S[10000],T[500],count = 0;
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &S[i]);
	}
	scanf_s("%d", &q);
	for (int i = 0; i < q; i++) {
		scanf_s("%d", &T[i]);
	}
	for (int i = 0; i < q; i++) {
		for (int j = 0; j < n; j++) {
			if (S[j] == T[i]) {
				count++; break;
			}
		}
	}
	printf("%d\n", count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <math.h>
int main(void)
{
	int n, q, S[10000], T[500], count = 0, i, j;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d", &S[i]);
	}
	scanf_s("%d", &q);
	for (i = 0; i < q; i++) {
		scanf_s("%d", &T[i]);
	}
	for (i = 0; i < q; i++) {
		for (j = 0; j < n; j++) {
			if (S[j] == T[i]) {
				count++; break;
			}
		}
	}
	printf("%d\n", count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
	int n, q, S[10000], T[500], count = 0, i, j;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d", &S[i]);
	}
	scanf_s("%d", &q);
	for (i = 0; i < q; i++) {
		scanf_s("%d", &T[i]);
	}
	for (i = 0; i < q; i++) {
		for (j = 0; j < n; j++) {
			if (S[j] == T[i]) {
				count++; break;
			}
		}
	}
	printf("%d\n", count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <vector>

const int N = 10000;

int main() {
  int n = 0;
  std::vector<int> S;

  S.reserve(N);

  std::cin >> n;

  for (int i = 0; i < n; i++) {
    int x = 0;

    std::cin >> x;

    S.push_back(x);
  }

  int q = 0;
  std::vector<int> T;

  T.reserve(N);

  std::cin >> q;

  for (int i = 0; i < q; i++) {
    int x = 0;

    std::cin >> x;

    T.push_back(x);
  }

  int count = 0;
  
  for (std::vector<int>::iterator i = S.begin(); i != S.end(); ++i) {
    for (std::vector<int>::iterator j = T.begin(); j != T.end(); ++j) {
      if (*i == *j) {
	count++;

	break;
      }
    }

    T.erase(j);
  }

  std::cout << count << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:13: error: 'j' was not declared in this scope
   48 |     T.erase(j);
      |             ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

void init(vector<int>& v){
  int n = 0;
  int input;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> input;
    v.push_back(input);
  }
  sort(v.begin(), v.end());
  v.erase( unique(v.begin(), v.end()), v.end() );
}

int linearsearch(int key, vector<int> t, int count){
  int i = 0;
  t.push_back(key);
  while(t[i]!=key){
    i++;
  }
  if(t.size()-1!=i) return count+1;
  else return count;
}

int main(int argc, char* argv[]){
  vector<int> a, b;
  int count = 0;
  init(a);
  init(b);
  for (auto i : a) count = linearsearch(i, b, count);
  cout << count << endl;
}

Compiler output:
a.cc: In function 'void init(std::vector<int>&)':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:15:12: error: 'unique' was not declared in this scope
   15 |   v.erase( unique(v.begin(), v.end()), v.end() );
      |            ^~~~~~
Language: C++

  #include <iostream>
  #include <vector>
 
 using namespace std;
 
  void init(vector<int>& v){
    int n = 0;
    int input;
    cin >> n;
    for(int i = 0; i < n; i++){
      cin >> input;
      v.push_back(input);
    }
    sort(v.begin(), v.end());
    v.erase( unique(v.begin(), v.end()), v.end() );
  }
 
  int linearsearch(int key, vector<int> t, int count){
    int i = 0;
    t.push_back(key);
    while(t[i]!=key){
      i++;
    }
    if(t.size()-1!=i) return count+1;
    else return count;
  }
 
  int main(int argc, char* argv[]){
    vector<int> a, b;
    int count = 0;
    init(a);
    init(b);
    for (auto i : a) count = linearsearch(i, b, count);
    cout << count << endl;
  }
 

Compiler output:
a.cc: In function 'void init(std::vector<int>&)':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
a.cc:15:14: error: 'unique' was not declared in this scope
   15 |     v.erase( unique(v.begin(), v.end()), v.end() );
      |              ^~~~~~
Language: C++

 linearSearch()
   i = 0
   A[n] = key
   while A[i] ??¨ key ?????°??????
     i++
   if i ??? n ????????????
     return NOT_FOUND
   return i

Compiler output:
a.cc:4:28: error: extended character ° is not valid in an identifier
    4 |    while A[i] ??¨ key ?????°??????
      |                            ^
a.cc:2:4: error: expected constructor, destructor, or type conversion before 'i'
    2 |    i = 0
      |    ^
Language: C++

#include <stdio.h>

int main(void)
{
	int n,S[10000],i,j,q,T[500],t,C;
	scanf("%d",&n);
	for (i=0;i!=n;i++){
		scanf("%d",&S[i]);
	}
	scanf("%d",&q);
	for (j=0;j!=q;j++){
		scanf("%d",&T[j]);
	}
	for (j=0;j!=q;j++){
		for (i=0;i!=q;i++){
			if(T[j]==T[i]){
				T[j]=T[j]-100;
			}
		}
	}
	C=0;
	for (i=0;i<q;i++){
		for (t=0;t<n;t++){
			if(T[i]==S[t]){
				C=C+1;
			}
		}
	}

	printf("%d",C);
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: expected '}' at end of input
   31 |         return 0;
      |                  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <stdio.h>
int main(void)
int n,S[10000],i,j,q,T[500],t,C;
	scanf("%d",&n);
	for(i=0;i!=n;i++){
		scanf("%d",&S[i]);
	}
	scanf("%d",&q);
	for(j=0;j!=q;j++){
		scanf("%d",&T[j]);
	}
	for(j=0;j!=q;j++){
		for(i=0;i!=q;i++){
			if(T[j]==T[i]){
				T[j]=T[j]-100;
			}
		}
	}
	C=0;
	for(i=0;i!=q;i++){
		for(t=0;t!=n;t++){
			if(T[i]==S[t]){
				C++;
			}
		}
	}
	for(i=0;i!=q;i++){
		for(t=0;t<n;t++){
			if(T[i]+100==S[t]){
				C++;
			}
		}
	}
	printf("%d",C);
	return 0;
}

Compiler output:
a.cc:3:1: error: expected initializer before 'int'
    3 | int n,S[10000],i,j,q,T[500],t,C;
      | ^~~
a.cc:4:14: error: expected constructor, destructor, or type conversion before '(' token
    4 |         scanf("%d",&n);
      |              ^
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for(i=0;i!=n;i++){
      |         ^~~
a.cc:5:17: error: 'i' does not name a type
    5 |         for(i=0;i!=n;i++){
      |                 ^
a.cc:5:22: error: 'i' does not name a type
    5 |         for(i=0;i!=n;i++){
      |                      ^
a.cc:8:14: error: expected constructor, destructor, or type conversion before '(' token
    8 |         scanf("%d",&q);
      |              ^
a.cc:9:9: error: expected unqualified-id before 'for'
    9 |         for(j=0;j!=q;j++){
      |         ^~~
a.cc:9:17: error: 'j' does not name a type
    9 |         for(j=0;j!=q;j++){
      |                 ^
a.cc:9:22: error: 'j' does not name a type
    9 |         for(j=0;j!=q;j++){
      |                      ^
a.cc:12:9: error: expected unqualified-id before 'for'
   12 |         for(j=0;j!=q;j++){
      |         ^~~
a.cc:12:17: error: 'j' does not name a type
   12 |         for(j=0;j!=q;j++){
      |                 ^
a.cc:12:22: error: 'j' does not name a type
   12 |         for(j=0;j!=q;j++){
      |                      ^
a.cc:19:9: error: 'C' does not name a type
   19 |         C=0;
      |         ^
a.cc:20:9: error: expected unqualified-id before 'for'
   20 |         for(i=0;i!=q;i++){
      |         ^~~
a.cc:20:17: error: 'i' does not name a type
   20 |         for(i=0;i!=q;i++){
      |                 ^
a.cc:20:22: error: 'i' does not name a type
   20 |         for(i=0;i!=q;i++){
      |                      ^
a.cc:27:9: error: expected unqualified-id before 'for'
   27 |         for(i=0;i!=q;i++){
      |         ^~~
a.cc:27:17: error: 'i' does not name a type
   27 |         for(i=0;i!=q;i++){
      |                 ^
a.cc:27:22: error: 'i' does not name a type
   27 |         for(i=0;i!=q;i++){
      |                      ^
a.cc:34:15: error: expected constructor, destructor, or type conversion before '(' token
   34 |         printf("%d",C);
      |               ^
a.cc:35:9: error: expected unqualified-id before 'return'
   35 |         return 0;
      |         ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <stdio.h>
int main(void)
int n,S[10000],i,j,q,T[500],t,C;
	scanf("%d",&n);
	for(i=0;i!=n;i++){
		scanf("%d",&S[i]);
	}
	scanf("%d",&q);
	for(j=0;j!=q;j++){
		scanf("%d",&T[j]);
	}
	for(j=0;j!=q;j++){
		for(i=0;i!=q;i++){
			if(T[j]==T[i]){
				T[j]=T[j]-100;
			}
		}
	}
	C=0;
	for(i=0;i!=q;i++){
		for(t=0;t!=n;t++){
			if(T[i]==S[t]){
				C=C+1;
			}
		}
	}
	for(i=0;i!=q;i++){
		for(t=0;t<n;t++){
			if(T[i]+100==S[t]){
				C=C+1;
			}
		}
	}
	printf("%d",C);
	return 0;
}

Compiler output:
a.cc:3:1: error: expected initializer before 'int'
    3 | int n,S[10000],i,j,q,T[500],t,C;
      | ^~~
a.cc:4:14: error: expected constructor, destructor, or type conversion before '(' token
    4 |         scanf("%d",&n);
      |              ^
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for(i=0;i!=n;i++){
      |         ^~~
a.cc:5:17: error: 'i' does not name a type
    5 |         for(i=0;i!=n;i++){
      |                 ^
a.cc:5:22: error: 'i' does not name a type
    5 |         for(i=0;i!=n;i++){
      |                      ^
a.cc:8:14: error: expected constructor, destructor, or type conversion before '(' token
    8 |         scanf("%d",&q);
      |              ^
a.cc:9:9: error: expected unqualified-id before 'for'
    9 |         for(j=0;j!=q;j++){
      |         ^~~
a.cc:9:17: error: 'j' does not name a type
    9 |         for(j=0;j!=q;j++){
      |                 ^
a.cc:9:22: error: 'j' does not name a type
    9 |         for(j=0;j!=q;j++){
      |                      ^
a.cc:12:9: error: expected unqualified-id before 'for'
   12 |         for(j=0;j!=q;j++){
      |         ^~~
a.cc:12:17: error: 'j' does not name a type
   12 |         for(j=0;j!=q;j++){
      |                 ^
a.cc:12:22: error: 'j' does not name a type
   12 |         for(j=0;j!=q;j++){
      |                      ^
a.cc:19:9: error: 'C' does not name a type
   19 |         C=0;
      |         ^
a.cc:20:9: error: expected unqualified-id before 'for'
   20 |         for(i=0;i!=q;i++){
      |         ^~~
a.cc:20:17: error: 'i' does not name a type
   20 |         for(i=0;i!=q;i++){
      |                 ^
a.cc:20:22: error: 'i' does not name a type
   20 |         for(i=0;i!=q;i++){
      |                      ^
a.cc:27:9: error: expected unqualified-id before 'for'
   27 |         for(i=0;i!=q;i++){
      |         ^~~
a.cc:27:17: error: 'i' does not name a type
   27 |         for(i=0;i!=q;i++){
      |                 ^
a.cc:27:22: error: 'i' does not name a type
   27 |         for(i=0;i!=q;i++){
      |                      ^
a.cc:34:15: error: expected constructor, destructor, or type conversion before '(' token
   34 |         printf("%d",C);
      |               ^
a.cc:35:9: error: expected unqualified-id before 'return'
   35 |         return 0;
      |         ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <stdio.h>}

int main(void){
	int n,i,S[100000],q,j,T,C = 0,M;
	scanf("%d",&n);
	for (i=0;i!=n;i++){
		scanf("%d",&S[i]);
	}
	for (i=0;i!=n;i++){
		for (j=0;j!=n;j++){
			if (S[i]<S[j]){
				M=S[i];
				S[i]=S[j];
				S[j]=M;
			}
		}
	}
	scanf("%d",&q);
	for (j=0;j!=q;j++){
		scanf("%d",&T);
		for (i=0;i<n;i++){
			if (S[i]=T){
				C++
				break;
			}
		}
	}
	printf("%d\n",C);
	
	return 0;
}

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>}
      |                   ^
a.cc: In function 'int main()':
a.cc:23:36: error: expected ';' before 'break'
   23 |                                 C++
      |                                    ^
      |                                    ;
   24 |                                 break;
      |                                 ~~~~~
Language: C++

#include <iostream>
using namespace std;
#define MAX 10000

int A[MAX];
int n,m,key;

int main(){
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  cin>>m;
  int count=0;
  for(int i=0;i<n;i++){
    cin>>key;
    count+=linearSerch();
  }

  cout<<count<<lend;
  return 0;
}

int linerSerch(){
  int i=0;
  A[n]=key;
  while(A[i]!=key){
    i++;
  }
  if(i==n) return NOT_FOUND;
  reutrn i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'linearSerch' was not declared in this scope
   17 |     count+=linearSerch();
      |            ^~~~~~~~~~~
a.cc:20:16: error: 'lend' was not declared in this scope
   20 |   cout<<count<<lend;
      |                ^~~~
a.cc: In function 'int linerSerch()':
a.cc:30:19: error: 'NOT_FOUND' was not declared in this scope
   30 |   if(i==n) return NOT_FOUND;
      |                   ^~~~~~~~~
a.cc:31:3: error: 'reutrn' was not declared in this scope
   31 |   reutrn i;
      |   ^~~~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

boolt LinearSearch(vector<int> S,int key)
{
	int i = 0;
	while(i != S.size()){
		if(S[i] == key){
			return true;
		}
		i++;
	}
	return false;
}

int main()
{
	int n;
	int q;
	int count = 0;
	int i = 0;
	vector<int> S;
	
	cin >> n;
	while(S.size() != n){
		int i;
		cin >> i;
		S.push_back(i);
	}
	
	cin >> q;
	while(i != q){
		i++;
		int key;
		cin >> key;
		if(count += LinearSearch(S,key))count+=;
	}
	cout << count << endl;
}

Compiler output:
a.cc:6:1: error: 'boolt' does not name a type; did you mean 'bool'?
    6 | boolt LinearSearch(vector<int> S,int key)
      | ^~~~~
      | bool
a.cc: In function 'int main()':
a.cc:38:29: error: 'LinearSearch' was not declared in this scope
   38 |                 if(count += LinearSearch(S,key))count+=;
      |                             ^~~~~~~~~~~~
a.cc:38:56: error: expected primary-expression before ';' token
   38 |                 if(count += LinearSearch(S,key))count+=;
      |                                                        ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

bool LinearSearch(vector<int> S,int key)
{
	int i = 0;
	while(i != S.size()){
		if(S[i] == key){
			return true;
		}
		i++;
	}
	return false;
}

int main()
{
	int n;
	int q;
	int count = 0;
	int i = 0;
	vector<int> S;
	
	cin >> n;
	while(S.size() != n){
		int i;
		cin >> i;
		S.push_back(i);
	}
	
	cin >> q;
	while(i != q){
		i++;
		int key;
		cin >> key;
		if(count += LinearSearch(S,key))count+=;
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:56: error: expected primary-expression before ';' token
   38 |                 if(count += LinearSearch(S,key))count+=;
      |                                                        ^
Language: C++

#include<iostream>
#include<cstdlib>

using namespace std;

int main(int argc, char const *argv[])
{
    int n,q,C=0;
    int S[10001], T[501];
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", &A[i]);
    }
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        scanf("%d", &T[i]);
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; i < q; ++i)
        {
            if (S[i]==T[j])
            {
                C++;
            }
        }
    }

    cout << C << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:22: error: 'A' was not declared in this scope
   13 |         scanf("%d", &A[i]);
      |                      ^
Language: C++

/* Linear Search */
#include<iostream>
using namespace std;
int main(){
  int n, q, cnt;
  
  cin >> n;
  int s[n];
  for(int i = 0; i < n; i++) cin >> s[i];

  cin >> q;
  int t[q];
  for(int j = 0; j < q; j++) cin >> t[j];

  for(int i = 0; i < n; i++){
    for(int j = 0; j < q; j++){
      if(s[i] == j[j]) cnt++;
    }
  }

  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: invalid types 'int[int]' for array subscript
   17 |       if(s[i] == j[j]) cnt++;
      |                   ^
Language: C++

/* Linear Search */
#include<iostream>
using namespace std;
int main(){
  int n, q, cnt;
  
  cin >> n;
  int s[n];
  for(int i = 0; i < n; i++) cin >> s[i];

  cin >> q;
  int t[q];
  for(int j = 0; j < q; j++) cin >> t[j];

  for(int i = 0; i < n; i++){
    for(int j = 0; j < q; j++){
      if(s[i] == j[j]) {cnt++; break;}
    }
  }

  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: invalid types 'int[int]' for array subscript
   17 |       if(s[i] == j[j]) {cnt++; break;}
      |                   ^
Language: C++

#include <iostream>

int liner(int A[],int b, int c){
	A[b]=c;
	int i=0;
	while(A[i] != c) i++;
	return i != b ;
}

int main(){
	int n,c,A[10000+1],b,sum;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&A[i]);
	}

	scanf("%d",&b){
		for(int i=0;i<b;i++){
				scanf("%d",&c);

			if (liner(A,n,c)) sum +=1;
			}
	}
	printf("%d",sum);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before '{' token
   17 |         scanf("%d",&b){
      |                       ^
      |                       ;
Language: C++

#include <stdio.h>

int liner(int A[],int b, int c){
	A[b]=c;
	int i=0;
	while(A[i] != c) i++;
	return i != b ;
}

int main(){
	int n,c,A[10000+1],b,sum;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&A[i]);
	}

	scanf("%d",&b){
		for(int i=0;i<b;i++){
				scanf("%d",&c);

			if (liner(A,n,c)) sum +=1;
			}
	}
	printf("%d",sum);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before '{' token
   17 |         scanf("%d",&b){
      |                       ^
      |                       ;
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <functional>
#include <algorithm>
#include <complex>
#include <map>
#include <cmath>
#include <string>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <istream>

using namespace std;

//--------------------------------------------------------------//

int n, s[1000000000], q, t[1000000000];
vector<int> h;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> t[i];
	}

	for (int i = 0; i < n; i++) {
		int f = s[i];
		for (int j = 0; j < q; j++) {
			int g = t[j];
			if (f == g) {
				h.push_back(f);
			}
		}
	}
	cout << h.size() << endl;
	return 0;
}

Compiler output:
/tmp/ccfH911R.o: in function `main':
a.cc:(.text+0x65): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0x94): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0xb3): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0xf8): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0x114): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0x126): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0x141): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccfH911R.o
/tmp/ccfH911R.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x17f): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccfH911R.o
a.cc:(.text+0x198): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccfH911R.o
collect2: error: ld returned 1 exit status
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lima = Integer.parseInt(in.readLine());
			String[] a = in.readLine().split(" ");
			
			in.readLine();
			String[] b = in.readLine().split(" ");
			
			Arrays.sort(a);
			Arrays.sort(b);
			
			int j = 0;
			for (int i = 0; i < lima; i++) {
				if (b[j].equals(a[i])) j++;
				j++;
			}
			
			System.out.println(j);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Arrays;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

include <stdio.h>
int search(int A[], int n, int key){
 int i=0;
 A[n]=key;
 while (A[i]!=key)i++;
 return i!=n;
 }

int main(){
 int i,n, A[10000+1],q,key,sum=0;
 scanf("%d", &n);
 for(i=0; i< n; i++) scanf("%d" ,&A[i]);

 scanf("%d",&q);
 for(i=0; i<q; i++){
  scanf("%d", &key);
  if(search(A, n, key)) sum++;
 }
 printf("%d\n", sum);
 return 0;
}
 

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:11:2: error: 'scanf' was not declared in this scope
   11 |  scanf("%d", &n);
      |  ^~~~~
a.cc:17:6: error: 'search' was not declared in this scope
   17 |   if(search(A, n, key)) sum++;
      |      ^~~~~~
a.cc:19:2: error: 'printf' was not declared in this scope
   19 |  printf("%d\n", sum);
      |  ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <stdio.h>
Language: C++

include<stdio.h>

int main(void) {
	int s[10000], t[500], n, q, i, c = 0, flag, j;
	
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &s[i]);
	}
	
	scanf("%d", &q);
	for (i = 0; i < q; i++)
	{
		scanf("%d", &t[i]);
	}
	
	for (i = 0; i < n; i++)
	{
		flag = 0;
		j = 0;
		do
		{
			if (s[i] == t[j])
			{
				c++;
				flag = 1;
			}
			j++
		} while (flag == 0);
	}
	
	printf("%d\n", c);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~