Language: C++

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define ll long long

const ll mod = 1e9 + 7;
const ll maxn = 2e5 + 5;
const double pi = 3.1415926535897932384626433832795028841971693993751058209749445923078;
//iostream::sync_with_stdio(false);

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |         ^
a.cc:17:17: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |                 ^
a.cc:17:25: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |                         ^
a.cc:17:33: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |                                 ^
a.cc:17:41: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |                                         ^
a.cc:17:49: error: invalid types 'int[int]' for array subscript
   17 |     if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2])
      |                                                 ^
a.cc:19:13: error: invalid types 'int[int]' for array subscript
   19 |         if(s[0] == s[1] && s[1] != s[2])
      |             ^
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |         if(s[0] == s[1] && s[1] != s[2])
      |                     ^
a.cc:19:29: error: invalid types 'int[int]' for array subscript
   19 |         if(s[0] == s[1] && s[1] != s[2])
      |                             ^
a.cc:19:37: error: invalid types 'int[int]' for array subscript
   19 |         if(s[0] == s[1] && s[1] != s[2])
      |                                     ^
a.cc:23:18: error: invalid types 'int[int]' for array subscript
   23 |         else if(s[0] == s[2] && s[0] != s[1])
      |                  ^
a.cc:23:26: error: invalid types 'int[int]' for array subscript
   23 |         else if(s[0] == s[2] && s[0] != s[1])
      |                          ^
a.cc:23:34: error: invalid types 'int[int]' for array subscript
   23 |         else if(s[0] == s[2] && s[0] != s[1])
      |                                  ^
a.cc:23:42: error: invalid types 'int[int]' for array subscript
   23 |         else if(s[0] == s[2] && s[0] != s[1])
      |                                          ^
a.cc:27:18: error: invalid types 'int[int]' for array subscript
   27 |         else if(s[1] == s[2] && s[0] != s[1])
      |                  ^
a.cc:27:26: error: invalid types 'int[int]' for array subscript
   27 |         else if(s[1] == s[2] && s[0] != s[1])
      |                          ^
a.cc:27:34: error: invalid types 'int[int]' for array subscript
   27 |         else if(s[1] == s[2] && s[0] != s[1])
      |                                  ^
a.cc:27:42: error: invalid types 'int[int]' for array subscript
   27 |         else if(s[1] == s[2] && s[0] != s[1])
      |                                          ^