Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int S;
  cin >> S;
  if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
    cout<<"Yes"<<endl;
  }
  else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
    cout<<"Yes"<<endl;
  }
  else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
    cout<<"Yes"<<endl;
  }
  else  cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |        ^~
a.cc:6:17: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |                 ^~
a.cc:6:26: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |                          ^~
a.cc:6:35: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |                                   ^~
a.cc:6:44: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |                                            ^~
a.cc:6:53: error: request for member 'at' in 'S', which is of non-class type 'int'
    6 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3)&&S.at(0)!=S.at(2)){
      |                                                     ^~
a.cc:9:13: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |             ^~
a.cc:9:22: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |                      ^~
a.cc:9:31: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |                               ^~
a.cc:9:40: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |                                        ^~
a.cc:9:49: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |                                                 ^~
a.cc:9:58: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |   else if(S.at(0)==S.at(2)&&S.at(1)==S.at(3)&&S.at(0)!=S.at(1)){
      |                                                          ^~
a.cc:12:13: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |             ^~
a.cc:12:22: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |                      ^~
a.cc:12:31: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |                               ^~
a.cc:12:40: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |                                        ^~
a.cc:12:49: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |                                                 ^~
a.cc:12:58: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |   else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)&&S.at(0)!=S.at(2)){
      |                                                          ^~