Language: C++

#include <iostream>
using namespace std;

int main(){
  int a;
  cin >> a;
  if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
    cout << "Yes" << endl;
  }
  else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
    cout << "Yes" << endl;
  }
  else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
  	cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |        ^
a.cc:7:16: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |                ^
a.cc:7:24: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |                        ^
a.cc:7:32: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |                                ^
a.cc:7:40: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |                                        ^
a.cc:7:48: error: invalid types 'int[int]' for array subscript
    7 |   if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]){
      |                                                ^
a.cc:10:13: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |             ^
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |                     ^
a.cc:10:29: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |                             ^
a.cc:10:37: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |                                     ^
a.cc:10:45: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |                                             ^
a.cc:10:53: error: invalid types 'int[int]' for array subscript
   10 |   else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]){
      |                                                     ^
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |             ^
a.cc:13:21: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |                     ^
a.cc:13:29: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |                             ^
a.cc:13:37: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |                                     ^
a.cc:13:45: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |                                             ^
a.cc:13:53: error: invalid types 'int[int]' for array subscript
   13 |   else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]){
      |                                                     ^