Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int N,N1;
	cin >> N;
	int X[N];
	int X1[N];
	int Y[N-1];
	for (int i = 0; i<N; i++) {
			cin >> X[i];
			cin >> X1[i];
	}
	for (i = 0; i<N; i++) {
		N1 = N;
		XoaPhanTu(X1, N1, i);
		int Y[i] = max(X1,N1-1)
		for (i = 0; i < N; i++) {
			N1[i] = N[i];
		}
	}
	for (i = 0; i < N; i++) {
		cout << Y[i] << endl;
	}
}
int max(int a[], int n) {
	int max = a[0];
	for (int i = 1; i < n; i++)
		if (max < a[i])
			max = a[i];
	return max;
}
void XoaPhanTu(int a[], int &n, int pos) {
	// Mang rong, khong the xoa.
	if (n <= 0) {
		return;
	}
	// Neu pos <= 0 => Xoa dau
	if (pos < 0) {
		pos = 0;
	}
	// Neu pos >= n => Xoa cuoi
	else if (pos >= n) {
		pos = n - 1;
	}
	// Dich chuyen mang
	for (int i = pos; i < n - 1; i++) {
		a[i] = a[i + 1];
	}
	// Giam so luong phan tu sau khi xoa.
	--n;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         for (i = 0; i<N; i++) {
      |              ^
a.cc:15:17: error: 'XoaPhanTu' was not declared in this scope
   15 |                 XoaPhanTu(X1, N1, i);
      |                 ^~~~~~~~~
a.cc:16:31: error: no matching function for call to 'max(int [N], int)'
   16 |                 int Y[i] = max(X1,N1-1)
      |                            ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:31: note:   variable-sized array type 'int [N]' is not a valid template argument
   16 |                 int Y[i] = max(X1,N1-1)
      |                            ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   16 |                 int Y[i] = max(X1,N1-1)
      |                            ~~~^~~~~~~~~
a.cc:21:14: error: 'i' was not declared in this scope
   21 |         for (i = 0; i < N; i++) {
      |              ^