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

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

#define CIN(a, b) cin >> a >> b
#define CIN(a) cin >> a
#define rep(i, n) for (int i = 0; i < n; i++)
#define COUT(a) cout << a << endl;
#define vec(n) vector<char> vect(n)

int main(){
    string s;
    CIN(a);
    vec(4);
    rep(i,3) {
        CIN(vect.at(i));
    }
    sort(vect);
    if(vect.at(0) == vect.at(1) && vect.at(2) == vect.at(3)){
        COUT("Yes");
    }
    else
    {
        COUT("No");
    }
}

Compiler output:
a.cc:11:9: warning: "CIN" redefined
   11 | #define CIN(a) cin >> a
      |         ^~~
a.cc:10:9: note: this is the location of the previous definition
   10 | #define CIN(a, b) cin >> a >> b
      |         ^~~
a.cc: In function 'int main()':
a.cc:18:9: error: 'a' was not declared in this scope
   18 |     CIN(a);
      |         ^
a.cc:11:23: note: in definition of macro 'CIN'
   11 | #define CIN(a) cin >> a
      |                       ^
a.cc:23:9: error: no matching function for call to 'sort(std::vector<char>&)'
   23 |     sort(vect);
      |     ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#define CIN(a,b) cin >> a >> b
#define CIN(a) cin >> a
#define rep(i, n) for (int i = 0; i < n; i++)
#define COUT(a) cout << a << endl;
#define vec(n) vector<char> vect(n)

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int main(){
    string s;
    CIN(a);
    vec(4);
    rep(i,3) {
        CIN(vect.at(i));
    }
    sort(vect);
    if(vect.at(0) == vect.at(1) && vect.at(2) == vect.at(3)){
        COUT("Yes");
    }
    else
    {
        COUT("No");
    }
}

Compiler output:
a.cc:2:9: warning: "CIN" redefined
    2 | #define CIN(a) cin >> a
      |         ^~~
a.cc:1:9: note: this is the location of the previous definition
    1 | #define CIN(a,b) cin >> a >> b
      |         ^~~
a.cc: In function 'int main()':
a.cc:18:9: error: 'a' was not declared in this scope
   18 |     CIN(a);
      |         ^
a.cc:2:23: note: in definition of macro 'CIN'
    2 | #define CIN(a) cin >> a
      |                       ^
a.cc:23:9: error: no matching function for call to 'sort(std::vector<char>&)'
   23 |     sort(vect);
      |     ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <cstring>
#include <sstream>
#include <unordered_map>
#include <unordered_set>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vii> vvii;

#define fastIO ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define forw(i,l,r) for(int i=(l);i<(r);i++)
#define forb(i,r,l) for(int i=(r);i>(l);i--)
#define sqr(x) (x)*(x)
#define log2i(x) 32 - __builtin_clz((x)) - 1
#define log2l(x) 64 - __builtin_clzll((x)) - 1
#define inf1 int(1e9+7)
#define inf2 0x3f3f3f3f
#define infll ll(1e18+7)
#define Pi acos(-1.0)
#define mu(x,y) trunc(exp(log((x))*(y)))
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()



int main() {
    fastIO;
    //freopen(".inp","r",stdin);
    //freopen(".out","w",stdout);

    cin >> s;
    sort(all(s));
    if(s[0]==s[1]&&s[2]==s[3]&&s[1]!=s[2]) cout << "Yes";
    else cout << "No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:12: error: 's' was not declared in this scope; did you mean 'se'?
   54 |     cin >> s;
      |            ^
      |            se
Language: C++

#include <iostream>
#includ <string>

using namespace std;

int main(void){
  string s;
  int now=0;
  int count[26]={};
  cin>>s;
  for(int i=0;i<=3;i++){
    count[s[i]-'A']++;
  }
  
  for(int i=0;i<=25;i++){
    if(count[i]==2){
      now++;
    }
  }
  
  if(now==2){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #includ; did you mean #include?
    2 | #includ <string>
      |  ^~~~~~
      |  include
Language: C

#include<stdio.h>
int main(void){
char S[5];
scanf("%s", &S);

if((S[0]==S[1]&&S[2]==S[3] &&S[0]!2=S[2])||
      (S[0]==S[2]&&S[1]==S[3] && S[0]!=S[1])|| 
         (S[0]==S[3]&&S[1]==S[2] &&S[0]!=S[1])){
    printf("Yes\n");
}else {
    printf("No\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:34: error: expected ')' before '!' token
    6 | if((S[0]==S[1]&&S[2]==S[3] &&S[0]!2=S[2])||
      |    ~                             ^
      |                                  )
Language: C

#include<stdio.h>
int main(void){
char S[5];
scanf("%s", &S);

if(S[0]==S[1]&&S[2]==S[3] &&S[0]!2=S[2]||S[0]==S[2]&&S[1]==S[3] && S[0]!=S[1]|| S[0]==S[3]&&S[1]==S[2] &&S[0]!=S[1]){
    printf("Yes\n");
}else {
    printf("No\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:33: error: expected ')' before '!' token
    6 | if(S[0]==S[1]&&S[2]==S[3] &&S[0]!2=S[2]||S[0]==S[2]&&S[1]==S[3] && S[0]!=S[1]|| S[0]==S[3]&&S[1]==S[2] &&S[0]!=S[1]){
      |   ~                             ^
      |                                 )
Language: C

#include<stdio.h>
int main(void){
char S[5];
scanf("%s", S);

if(S[0]=S[1]&&S[2]==S[3] &&S[0]!2=S[2]||S[0]==S[2]&&S[1]==S[3] && S[0]!=S[1]|| S[0]==S[3]&&S[1]==S[2] &&S[0]!=S[1]){
    printf("Yes\n");
}else {
    printf("No\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:32: error: expected ')' before '!' token
    6 | if(S[0]=S[1]&&S[2]==S[3] &&S[0]!2=S[2]||S[0]==S[2]&&S[1]==S[3] && S[0]!=S[1]|| S[0]==S[3]&&S[1]==S[2] &&S[0]!=S[1]){
      |   ~                            ^
      |                                )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	string k = "Yes";
	s.sort(s.begin(),s.end());
	if(s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(2) != s.at(3))
	{
		k = "No";
	}
	cout << k << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sort'
    8 |         s.sort(s.begin(),s.end());
      |           ^~~~
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    char[] a = sc.next().toCharArray();
    int counter1 = 0;
    int counter2 = 0;
    char tmp = null;
    for(int i = 0;i < 3;i++){
      for(int j = i + 1;j < 4;j++){
        if(a[i] == a[j]){
          tmp = a[i];
          counter1++;
        }
        if(a[i] == a[j] && tmp != a[i]){
          counter2++;
        }
      }
    }
    if(counter1 == 1 && counter2 == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");      
    }
  }
}

Compiler output:
Main.java:9: error: incompatible types: <null> cannot be converted to char
    char tmp = null;
               ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: expected ']' before '}' token
   11 |   else if (S[0] == S[2] && S[1] == S[3] && S[0} != S[1]){
      |                                               ^
      |                                               ]
a.cc:11:47: error: expected ')' before '}' token
   11 |   else if (S[0] == S[2] && S[1] == S[3] && S[0} != S[1]){
      |           ~                                   ^
      |                                               )
a.cc:11:47: error: expected primary-expression before '}' token
a.cc: At global scope:
a.cc:11:49: error: expected unqualified-id before '!=' token
   11 |   else if (S[0] == S[2] && S[1] == S[3] && S[0} != S[1]){
      |                                                 ^~
a.cc:14:3: error: expected unqualified-id before 'else'
   14 |   else if (S[0] == S[3] && S[1] == S[2] && S[0] != S[1]){
      |   ^~~~
a.cc:17:3: error: expected unqualified-id before 'else'
   17 |   else{
      |   ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
  int i,c1,c2;
  char c,t;
  c= s[0];
  c1=c2=0;
  for(i=0;i<4;i++)
  {
    if(c==s[i])
      c1++;}
 for(i=0;i<4;i++)
 {
   if(c!==s[i])
   { t=s[i];
    break;
   }
 }
  for(i=0;i<4;i++)
  {
    if(t==s[i])
      c2++;}
  if(c1==2&&c2==2)
    cout<<"Yes";
  else
    cout<<"No"; 
  return 0;
}

    


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected primary-expression before '=' token
   16 |    if(c!==s[i])
      |          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: 's' was not declared in this scope
    6 |     if(S[0]==S[1]&&S[2]==s[3])
      |                          ^
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
    char a[10];
    scanf("%s",a);
    if(a[0]==a[1]&&a[1]!=a[2]%%a[2]==a[3]){printf("Yes\n");}
    else if(a[0]==a[2]&&a[1]!=a[2]%%a[1]==a[3]){printf("Yes\n");}
    else if(a[0]==a[3]&&a[3]!=a[2]%%a[1]==a[2]){printf("Yes\n");}
    else {printf("No\n");}
}

Compiler output:
main.c: In function 'main':
main.c:7:31: error: expected expression before '%' token
    7 |     if(a[0]==a[1]&&a[1]!=a[2]%%a[2]==a[3]){printf("Yes\n");}
      |                               ^
main.c:8:36: error: expected expression before '%' token
    8 |     else if(a[0]==a[2]&&a[1]!=a[2]%%a[1]==a[3]){printf("Yes\n");}
      |                                    ^
main.c:9:36: error: expected expression before '%' token
    9 |     else if(a[0]==a[3]&&a[3]!=a[2]%%a[1]==a[2]){printf("Yes\n");}
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	string s;
	cin >> s;

	if(s.at(0)==a.at(1) && s.at(2)==s.at(3) && s.at(0)!=s.at(2))
		cout << "Yes" << endl;
	else if(s.at(0)==a.at(2) && s.at(1)==s.at(3) && s.at(0)!=s.at(1))
		cout << "Yes" << endl;
	else if(s.at(0)==a.at(3) && s.at(1)==s.at(2) && s.at(0)!=s.at(1))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'a' was not declared in this scope
    8 |         if(s.at(0)==a.at(1) && s.at(2)==s.at(3) && s.at(0)!=s.at(2))
      |                     ^
Language: C

#include<iostream>
using namespace std;
int main(){
    string s;
    char c;
    cin>>s;
    int i,j,d[4]={0};
    for(i=0;i<4;i++){
        c=s[i];
        for(j=0;j<4;j++){
            if(s[j]==c)
                d[i]=d[i]+1;
        }
    }
    j=0;
    for(i=0;i<4;i++){
        if(d[i]==2)
            j=j+1;
    }
    if(j==4)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
using namespace std;
int main()
{
int a=1,flag=0,l,ll,ft,ring=0,lll,fj=0;
char b,org[4]={'0'};
for(int i=0;i<4;i++){
    if(flag!=0){
        for(int i=0;i<4;i++){
            if(org[i]!=l&&org!=ll){
                ft=org[i];
                lll=i;
                ring=1;
            }
            if(ring==1&&org[lll]==org[i]&&i!=lll){
               fj=1;
            }
        }
    }
    else{
        break;
    }
    cin>>org[i];
}
for(int i=0;i<4;i++){
    for(int j=0;j<4;j++){
        if(org[i]==org[j]&&i!=j){
            a++;
            l=i;
            ll=j;
        }
    }
    if(a==2){
        flag++;
    }
}
if(fj==1){
    cout<<"Yes";
}
else{
    cout<<"No";
}
 return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long

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

  string S; cin >> S;
  map<char,ll> map;
  for (ll i = 0; i < S.size(); ++i) map[S[i]] += 1;
  if (map.size() == 2 && map[S[0]] == 2) cout << "Yes" << endl;
  else << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected primary-expression before '<<' token
   14 |   else << "No" << endl;
      |        ^~
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long

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

  ll S; cin >> S;
  map<char,ll> map;
  for (ll i = 0; i < S.size(); ++i) map[S[i]] += 1;
  if (map.size() == 2 && map[S[0]] == 2) cout << "Yes" << endl;
  else << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: request for member 'size' in 'S', which is of non-class type 'long long int'
   12 |   for (ll i = 0; i < S.size(); ++i) map[S[i]] += 1;
      |                        ^~~~
a.cc:12:42: error: invalid types 'long long int[long long int]' for array subscript
   12 |   for (ll i = 0; i < S.size(); ++i) map[S[i]] += 1;
      |                                          ^
a.cc:13:31: error: invalid types 'long long int[int]' for array subscript
   13 |   if (map.size() == 2 && map[S[0]] == 2) cout << "Yes" << endl;
      |                               ^
a.cc:14:8: error: expected primary-expression before '<<' token
   14 |   else << "No" << endl;
      |        ^~
Language: C++

S = sorted(input())
print('Yes' if S[0] != S[3] and S[0] == S[1] and S[2] == S[3] else 'No')


Compiler output:
a.cc:2:7: warning: multi-character character constant [-Wmultichar]
    2 | print('Yes' if S[0] != S[3] and S[0] == S[1] and S[2] == S[3] else 'No')
      |       ^~~~~
a.cc:2:68: warning: multi-character character constant [-Wmultichar]
    2 | print('Yes' if S[0] != S[3] and S[0] == S[1] and S[2] == S[3] else 'No')
      |                                                                    ^~~~
a.cc:1:1: error: 'S' does not name a type
    1 | S = sorted(input())
      | ^
Language: C++

#include <stdio.h>
int main()
{
 char s[5];
 gets(s);
 int a = 0, b = 0;
 char ch;
 int i;
 for(i = 0; i < 4; i++)
 {
  if(i == 0) a++, ch = s[i];
  else
  {
   if(s[i] == ch) a++;
   else b++;
  }
 }
 if(a == b) puts("YES");
 else puts("NO");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |  gets(s);
      |  ^~~~
      |  getw
Language: Java

#include<iostream>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

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

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<string.h>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:4: error: illegal character: '#'
#include<algorithm>
^
Main.java:10: error: not a statement
	cin >> s;
	    ^
Main.java:12: error: not a statement
		cout << "Yes" << endl;
		              ^
Main.java:15: error: not a statement
		cout << "No" << endl;
		             ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
8 errors
Language: C

#include <stdio.h>
int main(){
  char a[3];
  scanf("%s",&a);
  if(a[0]=a[1] && a[2]=a[3]){
    printf("Yes");
  }
  else{
    printf("No");
  }
}


Compiler output:
main.c: In function 'main':
main.c:5:23: error: lvalue required as left operand of assignment
    5 |   if(a[0]=a[1] && a[2]=a[3]){
      |                       ^
Language: C++

#include <bits/stdc++>
using namespace std;

int main(){
  vector<int> num(4);
  for(int i=0; i<4; ++i){
    char tmp;
    cin >> tmp;
    num.at(i) = (int)tmp;
  }
  
  sort(num.begin(), num.end());
  if(num.at(0)==num.at(1) && num.at(2)==num.at(3)){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
int main(){
  char s[10];
  int c,i,k;
  c == 0;
  scanf("%s",s);
  for(i=0;i<4;i++){
    for(k=0;k<4;k++){
      if(S[i] == S[k]) c++;
    }
  }
  if(c == 8) printf("Yes");
  else printf("No");
}

Compiler output:
main.c: In function 'main':
main.c:9:10: error: 'S' undeclared (first use in this function)
    9 |       if(S[i] == S[k]) c++;
      |          ^
main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main(){
char a,b,c,d;
cin>>a>>b>>c>>d;SS
if(a==b||b==c||c==d||d==a){
    cout<<"Yes";
}
else cout <<"No";
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'SS' was not declared in this scope
    5 | cin>>a>>b>>c>>d;SS
      |                 ^~
a.cc:9:1: error: 'else' without a previous 'if'
    9 | else cout <<"No";
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S ;

 if(S.at(0) == S.at(1) == S.at(2) == S.at(3)){
    cout << < "No" << endl;
}else if(
(S.at(0) == S.at(1) && S.at(2) == S.at(3))||
(S.at(0) == S.at(2) && S.at(1) == S.at(3))||
(S.at(0) == S.at(3) && S.at(1) == S.at(2))){
     cout << < "Yes" << endl;
}else{
  cout << "No"  << endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before '<' token
    9 |     cout << < "No" << endl;
      |             ^
a.cc:9:20: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |     cout << < "No" << endl;
      |               ~~~~~^~~~~~~
a.cc:14:14: error: expected primary-expression before '<' token
   14 |      cout << < "Yes" << endl;
      |              ^
a.cc:14:22: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |      cout << < "Yes" << endl;
      |                ~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
  	int j=0;
    for (int i=0 ; i<3 ; i++){
    if (S.at(i)==S.at(i+1))
    j++;
    }
    if (j=3)
    cout << "No" << endl;
   	return 0;
    }
    if (S.at(0)==S.at(1)&&S.at(3)==S.at(2)){
    cout << "Yes" << endl;
    return 0;
    }
    if (S.at(0)==S.at(2)&&S.at(1)==S.at(3)){
    cout << "Yes" << endl;
    return 0;
    }
    if (S.at(0)==S.at(3)&&S.at(1)==S.at(2)){
    cout << "Yes" << endl;
    return 0;
    }
    cout <<"No" << endl;
}


Compiler output:
a.cc:16:5: error: expected unqualified-id before 'if'
   16 |     if (S.at(0)==S.at(1)&&S.at(3)==S.at(2)){
      |     ^~
a.cc:20:5: error: expected unqualified-id before 'if'
   20 |     if (S.at(0)==S.at(2)&&S.at(1)==S.at(3)){
      |     ^~
a.cc:24:5: error: expected unqualified-id before 'if'
   24 |     if (S.at(0)==S.at(3)&&S.at(1)==S.at(2)){
      |     ^~
a.cc:28:5: error: 'cout' does not name a type
   28 |     cout <<"No" << endl;
      |     ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
    if (S.at(0)==S.at(1)&&S.at(3)==S.at(2))
    cout << "Yes" << endl;
    if else(S.at(0)==S.at(2)&&S.at(1)==S.at(3))
    cout << "Yes" << endl;
    if else(S.at(0)==S.at(3)&&S.at(1)==S.at(2))
    cout << "Yes" << endl;
    else 
    cout <<"No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected '(' before 'else'
    9 |     if else(S.at(0)==S.at(2)&&S.at(1)==S.at(3))
      |        ^~~~
      |        (
a.cc:11:8: error: expected '(' before 'else'
   11 |     if else(S.at(0)==S.at(3)&&S.at(1)==S.at(2))
      |        ^~~~
      |        (
a.cc:13:5: error: 'else' without a previous 'if'
   13 |     else
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
    if (S.at(0)==S.at(1)&&S.at(3)==S.at(2))
    cout << "Yes" << endl;
    if else(S,at(0)==S.at(2)&&S.at(1)==S.at(3))
    cout << "Yes" << endl;
    if else(S.at(0)==S.at(3)&&S.at(1)==S.at(2))
    cout << "Yes" << endl;
    else 
    cout <<"No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected '(' before 'else'
    9 |     if else(S,at(0)==S.at(2)&&S.at(1)==S.at(3))
      |        ^~~~
      |        (
a.cc:11:8: error: expected '(' before 'else'
   11 |     if else(S.at(0)==S.at(3)&&S.at(1)==S.at(2))
      |        ^~~~
      |        (
a.cc:13:5: error: 'else' without a previous 'if'
   13 |     else
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	string x;
	cin >> x;
	sort (x.begin() , x.end());
	if (x[0] == x[1] && x[0] != x[2] && x[2] == x[3])
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |         sort (x.begin() , x.end());
      |         ^~~~
      |         short
Language: C++

#include<iostream>
using namespace std;
int main()
{
    char a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a==b&&c==d&&a!=c&&a!=d)
    {
        cout<<"Yes";
    }
    else if(a==d&&b==c&&a!=b&&a!=c)
    {
        cout<<"Yes";
    }
    else if(a==c&&b==d&&a!=b&&a!=d)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }

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

#include < iostream.h>
using namespace std;
int main() {
    string S;
    cin >> S;
    
    sort(S.begin(), S.end());
    
    if (S[0] == S[1] && S[2] == S[3] && S[0] != S[2]) cout << "Yes";
    else cout << "No";
    return 0;
}

Compiler output:
a.cc:1:10: fatal error:  iostream.h: No such file or directory
    1 | #include < iostream.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main()
{
  char S[4];
  scanf("%s",S);
  sort(S.begin(),S.end());
  if(S[0]==S[1]&&S[1]!=S[2]&&S[2]==S[3]){
    printf("No\n");

  }else{
      printf("Yes\n");

  }
  return 0;


}


Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'sort' [-Wimplicit-function-declaration]
    6 |   sort(S.begin(),S.end());
      |   ^~~~
main.c:6:9: error: request for member 'begin' in something not a structure or union
    6 |   sort(S.begin(),S.end());
      |         ^
main.c:6:19: error: request for member 'end' in something not a structure or union
    6 |   sort(S.begin(),S.end());
      |                   ^
Language: Java

public class Main {
    public static void main(String[] args) {
        // TODO code application logic here
        int count = 0;
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String[] b = a.split("");
        for (int i = 0; i <= 2; i++) {
            for (int j =i+1; j <= 4; j++) {
                if(j==4){
                    continue;
                }
                if (b[i].equals(b[j])) {
                    count++;
                }
            }
        }
        if (count == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java


import java.util.Scanner;
public class ABC132a {
    public static void main(String[] args) {
        // TODO code application logic here
        int count=0;
        Scanner sc=new Scanner(System.in);
        String a=sc.next();
        for(int i=0;i<=3;i++){
            for(int j=0;j<=4;j++){
                if(a.charAt(i)==a.charAt(j)){
                    count++;
                }
            }
        }
        if(count==2){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
    
}


Compiler output:
Main.java:3: error: class ABC132a is public, should be declared in a file named ABC132a.java
public class ABC132a {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

int main() {
  string s,ans;
  set<ll>a;
  cin >> s;
  rep(i,sz(s)) a.insert((ll)s.at(i));
  ans = a.size()==2 ? "Yes" : "No"
  cout<< ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:35: error: expected ';' before 'cout'
   12 |   ans = a.size()==2 ? "Yes" : "No"
      |                                   ^
      |                                   ;
   13 |   cout<< ans << endl;
      |   ~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

int main() {
    string S;
    cin >> S;

    int count = 0;
    vector<char> vec;

    for (int i = 1; i < 4; i++)
    {
        if (S.at(0) == S.at(i))
        {
            count++;
        }
        else
        {
            vec.push_back(S.at(i));
        }
    }

    if (count == 1)
    {
        if (vec.size == 2)
        {
            if (vec.at(0) == vec.at(1))
            {
                cout << "Yes" << endl;
            }
        }
        else
        {
            cout << "No" << endl;
        }
    }
    else
    {
        cout << "No" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   30 |         if (vec.size == 2)
      |             ~~~~^~~~
      |                     ()
Language: C++

#include <iostream>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: expected primary-expression before '||' token
    9 |   else if(s[0] == s[1] && s[2] == s[3])||(s[0] == s[2] && s[1] == s[3])||(s[0] == s[3] && s[1] == s[2])cout << "Yes" << endl;
      |                                        ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int i,j;
        if(s[0]==s[1]&&s[2]==s[3]&&s[0]!=s[2]&&s[0]!=s[3])
        {
            cout<<Yes<<endl;
        }
        else if(s[0]==s[3]&&s[1]==s[2]&&s[0]!=s[1]&&s[0]!=s[3])
        {
            cout<<Yes<<endl;
        }
        else if(s[0]==s[2]&&s[1]==s[3]&&s[0]!=s[2]&&s[1]!=s[0]!=s[3])
        {
            cout<<Yes<<endl;
        }
        else
            cout<<No<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'Yes' was not declared in this scope
   10 |             cout<<Yes<<endl;
      |                   ^~~
a.cc:14:19: error: 'Yes' was not declared in this scope
   14 |             cout<<Yes<<endl;
      |                   ^~~
a.cc:18:19: error: 'Yes' was not declared in this scope
   18 |             cout<<Yes<<endl;
      |                   ^~~
a.cc:21:19: error: 'No' was not declared in this scope
   21 |             cout<<No<<endl;
      |                   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void){
  char s[4];
  cin >> s;
  char a,b;
  int n,m;
  int j=0;
  a = s[0];
  n++;
  if(s[1] != a){
    b=s[1];
    m++;
  }
  else n++;
  if((s[2] != a) || (s[2] != b)){
    j++;
  }
  else if( s[2] == a){
    n++;
  }
  else m++;
  if((s[3] != a) || (s[3] != b)){
    j++;
  }
  else if(s[3] == a){
    n++;
  }
  else m++;
  if(m == n){
    cout << "Yes" << endl;
    break;
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: break statement not within loop or switch
   33 |     break;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void){
  char s[4];
  scanf("%s",s);
  char a,b;
  int n,m;
  a = s[0];
  n++;
  if(s[1] != a){
    b=s[1];
    m++;
  }
  else n++;
  if((s[2] != a) || (s[2] != b)){
    printf("No");
    break;
  }
  else if( s[2] == a){
    n++;
  }
  else m++;
  if((s[3] != a) || (s[3] != b)){
    printf("No");
    break;
  }
  else if(s[3] == a){
    n++;
  }
  else m++;
  if(m == n){
    cout << "Yes" << endl;
    break;
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: break statement not within loop or switch
   18 |     break;
      |     ^~~~~
a.cc:26:5: error: break statement not within loop or switch
   26 |     break;
      |     ^~~~~
a.cc:34:5: error: break statement not within loop or switch
   34 |     break;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void){
  char s[4];
  scanf("%s",s);
  char a,b;
  int n,m;
  a = s[0];
  n++;
  if(s[1] != a){
    b=s[1];
    m++;
  }
  else n++;
  if((s[2] != a) || (s[2] != b)){
    printf("No")
    break;
  }
  else if( s[2] == a){
    n++;
  }
  else m++;
  if((s[3] != a) || (s[3] != b)){
    printf("No")
    break;
  }
  else if(s[3] == a){
    n++;
  }
  else m++;
  if(m == n){
    cout << "Yes" << endl;
    break;
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: expected ';' before 'break'
   17 |     printf("No")
      |                 ^
      |                 ;
   18 |     break;
      |     ~~~~~        
a.cc:25:17: error: expected ';' before 'break'
   25 |     printf("No")
      |                 ^
      |                 ;
   26 |     break;
      |     ~~~~~        
a.cc:34:5: error: break statement not within loop or switch
   34 |     break;
      |     ^~~~~
Language: Java

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();

        int[] A = new int[4];
        for (int i = 0; i < 4; i++) {
            A[i] = str.charAt(i);
        }
        Arrays.sort(A);

        if (A[0] == A[1] && A[2] == A[3] && A[0] != A[3]) {
            System.out.println("Yes");
        } else { 
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        Arrays.sort(A);
        ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

#include <iostream>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s = s && ss) {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'ss' was not declared in this scope; did you mean 's'?
    7 |   if (s = s && ss) {
      |                ^~
      |                s
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  if(s.at(0)==s.at(1) && s.at(2) == s.at(3)){
    cout << "Yes" << endl;
  }
  else if (s.at(0)==s.at(2) && s.at(1) == s.at(3)){
    cout << "Yes" << endl;
  }
  else if (s.at(0)==s.at(3) && s.at(1) == s.at(2)){
    cout << "Yes" << endl;
  }
  else if(s.at(0)==s.at(1) && s.at(2) == s.at(3) && s.at(1) == s.at(3))
  else{
    cout << "No" << endl;
  }
  
}


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

#include<bits/stdc++.h>
using namespace std;
typedef int shar;
typedef double shara;
typedef string w;
int main(){
    w s;
    cin>>s;
    if(s.at(0)==s.at(1)&&s.at(2)==s.at(3))
    {cout<<"Yes";}
    if(s.at(0)==s.at(2)&&s.at(1)==s.at(3))
    {cout<<"Yes";}
    {cout<<"Yes";}
    else if(s.at(1)==s.at(2)&&s.at(0)==s.at(3))
    {cout<<"Yes";}
    else{cout<<"No";}
    //0 1 2 3
    // 0==2 1==3
































  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else if(s.at(1)==s.at(2)&&s.at(0)==s.at(3))
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){int n;cin>>n;vector<int> d(n);for(int i=0;i<n;i++)cin>>d[i];sort(d.begin(),d.end());int mid1=(n-1)/2,mid2=mid1+1;cout<<d[mid2]-d[mid1]}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:146: error: expected ';' before '}' token
    3 | int main(){int n;cin>>n;vector<int> d(n);for(int i=0;i<n;i++)cin>>d[i];sort(d.begin(),d.end());int mid1=(n-1)/2,mid2=mid1+1;cout<<d[mid2]-d[mid1]}
      |                                                                                                                                                  ^
      |                                                                                                                                                  ;
Language: C++

#include <iostream>
#include <string>

int main(){
  string s;
  cin >> s;
  int a=0,d=0;
  char c=s[0];
  char b='_';
  for (int i=1; i<4; i++){
    if (c==s[i]) {
      a++;
    }
    else if (b==s[i]){
      d++;
    }
    else b=s[i]; 
  }
  if (a==1 && d==1) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:19:21: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   if (a==1 && d==1) cout << "Yes" << endl;
      |                     ^~~~
      |                     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   if (a==1 && d==1) cout << "Yes" << endl;
      |                                      ^~~~
      |                                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:20:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   else cout << "No" << endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   else cout << "No" << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
    char s[4];
    cin >> s;

    if (s[0] == s[1] && s[0] != s[2] && s[2] == s[3]) {
        cout << "Yes" << endl;
    }else if(s[0] == s[2] && s[1] != s[2] && s[1] == s[3]) {
        cout << "Yes" << endl;
    }else if (s[0] != s[3] && s[1] != s[3] && s[1] == s[2]) {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

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

#include<iostream>
using namespace std; 

int main()
{
  string S ;
  cin>>S ;
  int count[4]={0} ;
  for(int i=0;i<4;i++){
    for(int j=0;j!=i&&j<4;j++) if(S.at(i)==S.at(j)) count++ ;
    if(count[i]!=1){
      cout<<"No"<<endl ;
      return 0 ;
    }
  }
  cout<<"Yes"<<endl ;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:53: error: lvalue required as increment operand
   10 |     for(int j=0;j!=i&&j<4;j++) if(S.at(i)==S.at(j)) count++ ;
      |                                                     ^~~~~
Language: C++

#include<stdio.h>
int main()
{
	int b,i,cnt=0,leap=0;
	char a[10]={};
	int c[200]={};
	while(gets(a)){
		for(i=0;i<4;i++){
			b=a[i];
			c[b]++;
			if(c[b]){
				cnt++;
				if(c[b]==2){
					leap++;
				}
			}
		}if(cnt==4&&leap==2){
			printf("Yes\n");
		}else{
			printf("No\n");
		}cnt=0;leap=0;
	} 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |         while(gets(a)){
      |               ^~~~
      |               getw
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <utility>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef list<ll> listl;
typedef string str;
typedef vector<pair<ll,ll>> vpll

#define min(A, B) min(static_cast<ll>(A), static_cast<ll>(B))
#define max(A, B) max(static_cast<ll>(A), static_cast<ll>(B))
#define all(x) (x).begin(), (x).end()
#define mp make_pair

#define _rep(i, m)		for(ll i = 0, i_max = m; i < i_max; i++)
#define _erep(i, m)		for(ll i = 0, i_max = m; i <= i_max; i++)
#define _brep(i, b, m)	for(ll i = b, i_max = m; i < i_max; i++)
#define _ebrep(i, b, m)	for(ll i = b, i_max = m; i <= i_max; i++)
#define _rrep(i, m)		for(ll i = m; i >= 0; i--)
#define _rerep(i, b, e)	for(ll i = b; i >= e; i--)

#define rep(m)			_rep(i, m)
#define erep(m)			_erep(i, m)
#define brep(b, m)		_brep(i, b, m)
#define ebrep(b, m)		_ebrep(i, b, m)
#define rrep(m)			_rrep(i, m)
#define rerep(b, e)		_rerep(i, b, e)

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void in(ll& I)
{
	cin >> I;
}

void in(vl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(listl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(str& s)
{
	cin >> s;
}

void out(ll O)
{
	cout << O;
}

void out(vl& O)
{
	for (auto& o : O)
	{
		cout << o;
	}
}

void rout(bool b, str True, str False)
{
	if (b) cout << True.c_str();
	else cout << False.c_str();
}

int main()
{
	str s;
	
	cin >> s;
	sort(all(s));

	rout(s[0] == s[1] && s[2] == s[3] && s[1] != s[2], "Yes", "No");
	
	return 0;
}

Compiler output:
a.cc:35:1: error: expected initializer before 'll'
   35 | ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
      | ^~
a.cc: In function 'll lcm(ll, ll)':
a.cc:36:37: error: 'gcd' was not declared in this scope
   36 | ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
      |                                     ^~~
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <map>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d %d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);
#define SIZE 1000000007
using namespace std;
int gcd(int a, int b){return (a == 0) ? b : gcd(b%a, a);}
/*ios_base::sync_with_stdio(false);cin.tie(0);*/



int main (){
    ios_base::sync_with_stdio(false);cin.tie(0);
    string s;
    cin>>s;
    map<char,int>m1;
    for(auto &el:s)m1[el]++;
    for (int i = 0; i <s.size(); ++i) {
        if(mp[s[i]]%2==1){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
   40 |         if(mp[s[i]]%2==1){
      |              ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  string S;
  cin >> S;
  bool can=false;
  if(S[0]==S[1] && S[2]==S[3]) can =true;
  else if(S[0]==S[2] && S[1]==S[3]) can = true;
  if(S[0]==S[3] && S[1]==S[2]) can=true;
  #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  string S;
  cin >> S;
  bool can=false;
  if(S[0]==S[1] && S[2]==S[3]) can =true;
  else if(S[0]==S[2] && S[1]==S[3]) can = true;
  else if(S[0]==S[3] && S[1]==S[2]) can=true;
  if(S[0]==S[1] && S[1]==S[2] && S[2]==S[3]) can=false;
  if(can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   56 | int main(){
      |         ^~
a.cc:56:9: note: remove parentheses to default-initialize a variable
   56 | int main(){
      |         ^~
      |         --
a.cc:56:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:56:11: error: a function-definition is not allowed here before '{' token
   56 | int main(){
      |           ^
a.cc:66:2: error: expected '}' at end of input
   66 | }
      |  ^
a.cc:25:11: note: to match this '{'
   25 | int main(){
      |           ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  
  for(int i = 0;i < 4;i++){
    int ans;
    ans = 0;
    
    if(S[i] == S[i+1]) {
      ans++;
    } else{
      continue;
    }
  
    return ans;
  }
  
  if(ans == 1){
    cout << "YES" << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |   if(ans == 1){
      |      ^~~
      |      abs