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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected primary-expression before '=' token
    9 |     if(s[2]==s[3]!==s[0])
      |                    ^
a.cc:15:20: error: expected primary-expression before '=' token
   15 |     if(s[1]==s[3]!==s[0])
      |                    ^
a.cc:21:20: error: expected primary-expression before '=' token
   21 |     if(s[2]==s[1]!==s[0])
      |                    ^
Language: C++

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

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

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:10: error: expected primary-expression before 's'
    6 |   string s;
      |          ^
a.cc:6:10: error: expected '}' before 's'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin >> s;
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(s[0]==s[1]){
      |   ^~
a.cc:14:3: error: expected unqualified-id before 'else'
   14 |   else if(s[0]==s[2]){
      |   ^~~~
a.cc:20:3: error: expected unqualified-id before 'else'
   20 |   else if(s[0]==s[3]){
      |   ^~~~
a.cc:27:3: error: expected unqualified-id before 'return'
   27 |   return 0;
      |   ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: Java

import java.util.Scanner;
import java.util.regex.Pattern;

public class A {

    public static void main(String[] args) {
	Scanner str = new Scanner(System.in);

	String S;
	String x[];

	do {
	    S = str.nextLine();

	    x = S.split("");
	} while (x.length != 4 || !Character.isUpperCase(S.charAt(0)) || !Character.isUpperCase(S.charAt(1)) || !Character.isUpperCase(S.charAt(2)) || !Character.isUpperCase(S.charAt(3)));

	int m = 0;

	for (int i = 0; i < x.length - 1; i++) {
	    for (int j = i + 1; j < x.length; j++) {
		if (x[i].compareTo(x[j]) == 0) {
		    m++;
		}
	    }
	}

	if (m == 2) {
	    System.out.println("Yes");
	} else {
	    System.out.println("No");
	}
    }
}

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

#include <iostream> 
using namespace std;
int main ()
{
    int s;
    cin>>s;
    int shuma=0;
    for(int i=0;i<3;i++)
    {
      for(int j=i+1;j<4;j++)
      {
          if(s[i]==s[j])
          {
              shuma++;
          }
      }
    }
    if(shuma==2)
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: invalid types 'int[int]' for array subscript
   12 |           if(s[i]==s[j])
      |               ^
a.cc:12:21: error: invalid types 'int[int]' for array subscript
   12 |           if(s[i]==s[j])
      |                     ^
Language: C++

#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>

#define repd(i,a,b); for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define ll long long int
 
 
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt1=0,cnt2=0;
  if(s[0] == s[1]){
    if(s[0] != s[2] && s[2] == s[3]){
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  } else { 
    if(s[0] == s[2]){
      if(s[1] == s[3] && s[0] != s[1]){
        cout << "Yes";
        return 0;
      } else {
        cout << "No"
        return 0;
      }
    }
  }
  if(s[0] == s[3]){
    if(s[1] == s[2] && s[0] != s[1]){
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  } else {
    cout << "No"
  }
 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: expected ';' before 'return'
   33 |         cout << "No"
      |                     ^
      |                     ;
   34 |         return 0;
      |         ~~~~~~       
a.cc:47:17: error: expected ';' before '}' token
   47 |     cout << "No"
      |                 ^
      |                 ;
   48 |   }
      |   ~
Language: Java

import jaca.util.*;


class Main(){
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    ArrayList<String> list = new ArrayList<String>();
    for(int i = 0; i < a.length(); i++){
      list.add = a.charAt(i);
    }
    Collection.sort(list);
    int flag = 0;
    String ans = No;
    for(int i = 0; i < list.size() - 1; i ++){
      if(list.get(i) == list.get(i + 1)){
        flag++;
      }
    }
    if(flag = 1){
      ans = "Yes";
    }
    System

Compiler output:
Main.java:4: error: '{' expected
class Main(){
          ^
Main.java:23: error: not a statement
    System
    ^
Main.java:23: error: reached end of file while parsing
    System
          ^
3 errors
Language: C++

#include <stdio.h>

int main(void){
    char S[10];
    scanf("%s",S);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: expected '}' at end of input
   34 |     return 0;
      |              ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include"bits/stdc++.h"
using namespace std;
namespace ORIGIN {
#define LL long long
#define VLL vector<long long>
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define rep(i,n) for(int i=0;i<n;i++)
#define COUT(x) cout<<x<<endl
#define WHOLE(x) x.begin(),x.end()
	double pai = 3.1415926535;
	string atc = "atcoder";
	typedef pair<long long, long long> data_t;
	string strnum = "0123456789";
	string alpS = "abcdefghijklmnopqrstuvwxyz";
	string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int sizealp = (int)(alpS.size());
	int mod = 1e9 + 7;
	bool test = false;
}
using namespace ORIGIN;

#define aise akdj

void Test(char a) {
	if (test) {
		printf("%c", a);
	}
}
int gcd(LL a, LL b) {
	if (a == 0 || b == 0)return 0;
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	else gcd(b, a % b);
}

int main() {
	stirng 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:38:9: error: 'stirng' was not declared in this scope
   38 |         stirng s;
      |         ^~~~~~
a.cc:39:13: error: 's' was not declared in this scope
   39 |         if (s[0] == s[1] && s[2] == s[3])COUT("Yes");
      |             ^
a.cc: In function 'int gcd(long long int, long long int)':
a.cc:34:17: warning: control reaches end of non-void function [-Wreturn-type]
   34 |         else gcd(b, a % b);
      |              ~~~^~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: lvalue required as left operand of assignment
    7 | if (S[0]==S[1] && S[0]!=S[2] && S[2]=S[3]) cout << "Yes";
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]!=s[2]){
        printf("Yes\n");
    }else if(s[0]==s[2]&&s[1]==s[3]&&s[0]!=s[1]){
        printf("Yes\n");
    }else if(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:24: error: lvalue required as left operand of assignment
    6 |     if(s[0]==s[1]&&s[2]=s[3]&&s[0]!=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]!=s[2]){
        printf("Yes\n");
    }else if(s[0]==s[2]&&s[1]==s[3]&&s[0]!=s[1]){
        printf("Yes\n");
    }else if(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:5:15: error: request for member 's' in something not a structure or union
    5 |     scanf("%s".s);
      |               ^
main.c:6:24: error: lvalue required as left operand of assignment
    6 |     if(s[0]==s[1]&&s[2]=s[3]&&s[0]!=s[2]){
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a[26]={0};
  for(int i=0;s[i];i++)
    a[s[i]-'a']++;
  for(int i=0;i<26;i++){
    if(a[i]==2){
      for(int j=i+1;j<26;j++){
        if(a[j]==2){
          cout<<"Yes"<<endl;
          return 0;
        }
      }
    }
  }
  cout<<"No"endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: unable to find string literal operator 'operator""endl' with 'const char [3]', 'long unsigned int' arguments
   19 |   cout<<"No"endl;
      |         ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a[26]={0};
  for(int i=0;s[i];i++)
    a[s[i]-'a']++;
  for(int i=0;i<26;i++){
    if(a[i]==2){
      for(int j=i+1;j<26){
        if(a[j]==2){
          cout<<"Yes"<<endl;
          return 0;
        }
      }
    }
  }
  cout<<"No"endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before ')' token
   11 |       for(int j=i+1;j<26){
      |                         ^
      |                         ;
a.cc:19:9: error: unable to find string literal operator 'operator""endl' with 'const char [3]', 'long unsigned int' arguments
   19 |   cout<<"No"endl;
      |         ^~~~~~~~
Language: C++

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

Compiler output:
a.cc:6:9: error: extended character 、 is not valid in an identifier
    6 |   int a=0、b=0;
      |         ^
a.cc: In function 'int main()':
a.cc:6:9: error: unable to find numeric literal operator 'operator""\U00003001b'
    6 |   int a=0、b=0;
      |         ^~~~
a.cc:13:11: error: 'b' was not declared in this scope
   13 |           b++;
      |           ^
a.cc:17:9: error: 'b' was not declared in this scope
   17 |   if(a==b&&a==1)
      |         ^
Language: C++

#include<stdio.h> 
int main(){
	char s[5];
	int i,sum[92]={0},c=0;
	gets(s);
	for(i=0;i<4;i++){
		sum[s[i]]++;
	}
	for(i=65;i<92;i++){
		if(sum[i]==2)
			c++;
	}
	if(c==2) printf("Yes\n");
	else printf("No\n");
}

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

#include<stdio.h> 
//#include<string.h>
//#include<math.h>
int main(){
	char s[5];
	int i,sum[92]={0},c=0;
	gets(s);
	for(i=0;i<4;i++){
		sum[s[i]]++;
	}
	for(i=65;i<92;i++){
		if(sum[i]!=0)
			c++;
	}
	if(c==2) printf("Yes\n");
	else printf("No\n");
}

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

ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o	iwehp2qiuelwqey ow8rp92ryhq

Compiler output:
a.cc:1:40: warning: missing terminating ' character
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |                                        ^
a.cc:1:40: error: missing terminating ' character
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'ejp' does not name a type
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      | ^~~
a.cc:1:5: error: 'm3ihjtmp' does not name a type
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |     ^~~~~~~~
a.cc:1:14: error: expected unqualified-id before numeric constant
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |              ^~~~~~~
a.cc:1:28: error: expected unqualified-id before numeric constant
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |                            ^~~
a.cc:1:35: error: 'OJEIE' does not name a type
    1 | ejp;m3ihjtmp;2HUPFQW[HFDU ;2OI HR;OJEIE';Oqhe;o iwehp2qiuelwqey ow8rp92ryhq
      |                                   ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.Console;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.util.TreeMap;

import javax.naming.ldap.SortControl;

public class Main1 {

	static FastReader input = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		String s = input.nextLine();
		int[] a = new int[60];
		for (int i = 0; i < s.length(); i++) {
			a[s.charAt(i) - 'A']++;
		}

		boolean isOk = true;
		for (int i = 0; i < a.length; i++) {
			if (a[i] != 0 && a[i] != 2) {
				isOk = false;
				break;
			}
		}
		out.println(isOk ? "Yes" : "No");
		out.flush();
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		String nextLine() throws IOException {
			String str = "";
			str = br.readLine();
			return str;
		}
	}

	static class con {
		static int IINF = (int) 1e9;
		static int _IINF = (int) -1e9;
		static long LINF = (long) 1e15;
		static long _LINF = (long) -1e15;
		static double EPS = 1e-9;
	}

	static class Triple implements Comparable<Triple> {
		int x;
		int y;
		int z;

		Triple(int x, int y, int z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}

		@Override
		public int compareTo(Triple o) {
			if (x == o.x && y == o.y)
				return z - o.z;
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}
	}

	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		Pair(int x, int y) {
			this.x = x;
			this.y = y;

		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}
	}

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int r = i + (int) (Math.random() * (a.length - i));
			int tmp = a[r];
			a[r] = a[i];
			a[i] = tmp;
		}
	}

}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;

int main(){
	string c;
	cin >> c;
	sort(c.bigin(), c.end());
	if(c[0]==c[1] and c[1]!=c[2] and c[2]==c[3])
		cout << "Yes" << endl;
	else
		coput << "No" << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
   11 |         sort(c.bigin(), c.end());
      |                ^~~~~
      |                begin
a.cc:15:17: error: 'coput' was not declared in this scope
   15 |                 coput << "No" << endl;
      |                 ^~~~~
Language: C++

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

int main()
{
	char c[4];
	cin>>s;
	int tbl[26];
	memset(tbl,0,sizeof(tbl));
	
	for(int i=0; i<strlen(c); i++)
		tbl[c-'A']++;
	
	for(i=0; i<26; i++)
		if(tbl[i]==1)
		{
			cout<<"No";
			return 0;
		}
	cout<<"Yes";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 's' was not declared in this scope
    8 |         cin>>s;
      |              ^
a.cc:13:20: error: invalid types 'int [26][char*]' for array subscript
   13 |                 tbl[c-'A']++;
      |                    ^
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i=0; i<26; i++)
      |             ^
Language: C

#include<iostream>
using namespace std;

int main()
{
	string s;
	cin>>s;
	if(s.find(s[0],s.find(s[0])+1)!=string::npos && 
	   s.find(s[1],s.find(s[1])+1)!=string::npos && 
	   s.find(s[2],s.find(s[2])+1)!=string::npos && 
	   s.find(s[3],s.find(s[3])+1)!=string::npos)
		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: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        
        else if(s[0].equals(s[1]) && s[2].equals(s[3]) && !(s[0].equals(s[2]))) System.out.println("Yes");
        else if(s[0].equals(s[2]) && s[1].equals(s[3])) System.out.println("Yes");
        else if(s[0].equals(s[3]) && s[1].equals(s[2])) System.out.println("Yes");
        else System.out.println("No");
        
    }
}


Compiler output:
Main.java:9: error: 'else' without 'if'
        else if(s[0].equals(s[1]) && s[2].equals(s[3]) && !(s[0].equals(s[2]))) System.out.println("Yes");
        ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        
        else if(s[0].equals(s[1]) && s[2].equals(s[3]) && !(s[0].equals(s[2])) System.out.println("Yes");
        else if(s[0].equals(s[2]) && s[1].equals(s[3])) System.out.println("Yes");
        else if(s[0].equals(s[3]) && s[1].equals(s[2])) System.out.println("Yes");
        else System.out.println("No");
        
    }
}


Compiler output:
Main.java:9: error: ')' expected
        else if(s[0].equals(s[1]) && s[2].equals(s[3]) && !(s[0].equals(s[2])) System.out.println("Yes");
                                                                              ^
Main.java:9: error: 'else' without 'if'
        else if(s[0].equals(s[1]) && s[2].equals(s[3]) && !(s[0].equals(s[2])) System.out.println("Yes");
        ^
2 errors
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
public class Hello {
    public static void main(String args[]){
 Scanner sc=new Scanner(System.in);
        int i,flag=0;
        int[] count=new int[26];
        String s1=sc.next();
       
        char[] arr=s1.toCharArray();
        for(i=0;i<arr.length;i++){
            count[arr[i]-'A']++;
        }
        for(int n:count){
            if(n==2){
                flag=1;
               }
               else if(n==1){
                   flag=0;
               }
        }
        if(flag==1)
         System.out.println("YES");
         else
         System.out.println("NO");
}

}

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

a,b,c,d = input()
flag = 0
if(a==b and c==d):
    flag = 1
elif(a==c and b==d):
    flag = 1
elif(a==d and b==c):
    flag = 1
else:
    flag = 0
if(a==b and a==c and a==d):
    flag = 0
if(flag==1):
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,c,d = input()
      | ^
Language: C

#include<studio.h>
#include<string.h>

int main(){
	int i,j,count=0;
	char S[5];
	
	scanf(”%s”,&S);
	for(i=0;i<4;i++){
		for(j=0;j<4;j++){
			if(S[i]==S[j] && i!=j) count++;
		}
	}
	if(count == 4) printf(”Yes\n”);
	else printf(”No\n”);
	return 0;
}

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

#include<studio.h>

int main(){
	int i,j,count=0;
	char S[5];
	
	scanf(”%s”,&S);
	for(i=0;i<4;i++){
		for(j=0;j<4;j++){
			if(S[i]==S[j] && i!=j) count++;
		}
	}
	if(count == 4) printf(”Yes”);
	else printf(”No”);
	return 0;
}

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

#include <iostream>
using namespace std;

int main() {
	string s;
  	cin >> s;
  	vector<int> vec(26);
  	for (char c : s) {
      vec[c-'A']++;
    }
  for (int x : vec) {
    if (x && x != 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> vec(26);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> vec(26);
      |                ^~~
a.cc:9:7: error: 'vec' was not declared in this scope
    9 |       vec[c-'A']++;
      |       ^~~
a.cc:11:16: error: 'vec' was not declared in this scope
   11 |   for (int x : vec) {
      |                ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void){
  char a[8];
  if(scanf("%s", a)==1)
    continue;
  
  if((a[0]==a[1])&&(a[2]==a[3])&&(a[1]==a[2]))      printf("Yes");
  else if((a[0]==a[2])&&(a[1]==a[3])&&(a[0]!=a[1]))	printf("Yes");
  else if((a[0]==a[3])&&(a[1]==a[2])&&(a[0]!=a[1]))	printf("Yes");
  else printf("No");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: continue statement not within a loop
    8 |     continue;
      |     ^~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int cmp(int a,int b){
  return a-b;
}

void swap(int pos1,int pos2,int *data){
	char *temp;
	temp = data[pos1];
	data[pos1]=data[pos2];
	data[pos2]=temp;
	return;
}

void sort(int size,int *data){
  int end, i;
  for (end=size;end>0;end--) {
  for (i=0;i<end-1;i++) {
  	if (data[i]>data[i+1]) swap(i, i+1);
  	}
  }
}

int main(){
  int size,ans=0,i,arc=0,abs=0;
  int k,j;
  
  scanf("%d",&size);
  int num[size];
  
  for(i=0;i<size;i++){
    scanf("%d",&num[i]);
  }
  
  sort(size,num);
  
  if(num[size/2]==num[(size/2) -1])printf("0\n");
  else printf("%d\n",num[(size/2)-1]-num[size/2]);
  
  printf("%d\n",ans);
  return 0;
}


Compiler output:
main.c: In function 'swap':
main.c:9:14: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    9 |         temp = data[pos1];
      |              ^
main.c:11:19: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   11 |         data[pos2]=temp;
      |                   ^
main.c: In function 'sort':
main.c:19:32: error: too few arguments to function 'swap'
   19 |         if (data[i]>data[i+1]) swap(i, i+1);
      |                                ^~~~
main.c:7:6: note: declared here
    7 | void swap(int pos1,int pos2,int *data){
      |      ^~~~
Language: C

#include <stdio.h>

int main(){
  char text[5];
  scanf("%s",text);
  
  if(text[0]==text[1]&&text[2]==Text[3]) printf("Yes\n");
  else if(text[0]==text[2]&&text[1]==text[3]) printf("Yes\n");
  else if(text[0]==text[3]&&text[1]==text[2]) printf("Yes\n");
  else printf("No\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:33: error: 'Text' undeclared (first use in this function); did you mean 'text'?
    7 |   if(text[0]==text[1]&&text[2]==Text[3]) printf("Yes\n");
      |                                 ^~~~
      |                                 text
main.c:7:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

int main(void){
	int cnt = 0;
  	char s[4];

	scanf_s("%s",s);
  
  if(strcmp(&s[0],&s[1])==1){
  	cnt++;
  }
    if(strcmp(&s[0],&s[2])==1){
  	cnt++;
  }
    if(strcmp(&s[0],&s[3])==1){
  	cnt++;
  }
    if(strcmp(&s[1],&s[2])==1){
  	cnt++;
  }
    if(strcmp(&s[1],&s[3])==1){
  	cnt++;
  }
    if(strcmp(&s[2],&s[3])==1){
  	cnt++;
  }
  if(cnt == 2){
   printf("Yes");
  }else{
   printf("No");
  }
  
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%s",s);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
#include<String.h>

void main(int){
	int i = 0;
	int cnt = 0;
  	char s[4];

	scanf("%c",s[0]);
	scanf("%c",s[1]);
	scanf("%c",s[2]);
    scanf("%c",s[3]);
  
  if(strcmp(s[0],s[1]==1)){
  	cnt++;
  }
    if(strcmp(s[0],s[2]==1)){
  	cnt++;
  }
    if(strcmp(s[0],s[3]==1)){
  	cnt++;
  }
    if(strcmp(s[1],s[2]==1)){
  	cnt++;
  }
    if(strcmp(s[1],s[3]==1)){
  	cnt++;
  }
    if(strcmp(s[2],s[3]==1)){
  	cnt++;
  }
  if(cnt == 2){
   printf("Yes")
  }else{
   printf("No")
  }
  
  return 0;

}

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

#include <iostream>


int main() {
  char a = '.', b = ',';
  
  int l = 0, r = 0;
  for (size_t i = 0; i < 4; ++i) {
    char c;
    std::cin >> c
    if (a == '.') {
      a = c;
    } else if (b == ',') {
      b = c;
    } else {
      if (c == a) {
        ++l;
      } else if (c == b) {
        ++r;
      } else {
        std::cout << "No" << std::endl;
        return 0;
      }
    }
  }
  if (l && r) {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'if'
   10 |     std::cin >> c
      |                  ^
      |                  ;
   11 |     if (a == '.') {
      |     ~~            
a.cc:13:7: error: 'else' without a previous 'if'
   13 |     } else if (b == ',') {
      |       ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
	char s[10];
	gets(s+1);
	int m=1;
	char c[10];
	c[1]=s[1];
	for (int i=2;i<=4;i++){
		int k=1;
		for (int j=1;j<=m;j++)
			if (c[j]==s[i]) k=0;
		if (k) m++,c[m]=s[i];
	}
	if (m==2) puts("Yes");else puts("No");
	return 0;
} 

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

#include<bits/stdc++.h>
int main(){
	char s[10];
	gets(s+1);
	int m=1;
	char c[10];
	c[1]=s[1];
	for (int i=2;i<=4;i++){
		int k=1;
		for (int j=1;j<=m;j++)
			if (c[j]==s[i]) k=0;
		if (k) m++,c[m]=s[i];
	}
	if (m==2) puts("Yes");else puts("No");
	return 0;
} 

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

#include <iostream>
using namespace std;
 
int solve(){
  	char c;
  	int cnt[50] = {};
  	for(int i = 0; i < 4; i++){
		cin >> c;
      	cnt[c-'A']++;
    }
  	for(int i = 0; i < 50; i++){
		if(cnt[i] != 0 && cnt[i] != 2)return 0;
    }
  	return 1;
}
 
 
int main(){
	cout << solve() ? "Yes" : "No" << endl;
	return 0;
}
#include <iostream>
using namespace std;

int solve(){
  	char c;
  	int cnt[50] = {};
  	for(int i = 0; i < 4; i++){
		cin >> c;
      	cnt[c-'A']++;
    }
  	for(int i = 0; i < 50; i++){
		if(cnt[i] != 0 && cnt[i] != 2)return 0;
    }
  	return 1;
}


int main(){
	cout << (solve() ? "Yes" : "No") << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |         cout << solve() ? "Yes" : "No" << endl;
      |                                   ~~~~~^~~~~~~
a.cc: At global scope:
a.cc:25:5: error: redefinition of 'int solve()'
   25 | int solve(){
      |     ^~~~~
a.cc:4:5: note: 'int solve()' previously defined here
    4 | int solve(){
      |     ^~~~~
a.cc:39:5: error: redefinition of 'int main()'
   39 | int main(){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int solve(){
  	char c;
  	int cnt[50] = {};
  	for(int i = 0; i < 4; i++){
		cin >> c;
      	cnt[c-'A']++;
    }
  	for(int i = 0; i < 50; i++){
		if(cnt[i] != 0 && cnt[i] != 2)return 0;
    }
  	return 1;
}


int main(){
	cout << solve() ? "Yes" : "No" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |         cout << solve() ? "Yes" : "No" << endl;
      |                                   ~~~~~^~~~~~~
Language: C++

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

int main(){
  stirng s;
  char n[2];
  int num[2], i;
  cin >> s;
  n[1] = s[1];
  num[1] = 1;
  for(i = 1; i < s.size(); i++){
    if(s[i] == n[1]){
      if(num[1] != 2){
      	num[1]++;
      } else {
        cout << "No";
      }
    } else if(s[i] == n[2]){
      if(num[2] != 2){
        num[2]++;
      } else {
        cout << "No";
      }
    } else if(n[2] == ' '){
      n[2] = s[i];
    } else {
      cout << "No";
    }
  }
  
  cout << "Yes";
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng s;
      |   ^~~~~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
Language: C++

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

int main(){
  stirng s;
  char n[2];
  int num[2];
  cin >> s;
  n[1] = s[1];
  num[1] = 1;
  for(i = 1; i < s.size(); i++){
    if(s[i] == n[1]){
      if(num[1] != 2){
      	num++;
      } else {
        cout << "No";
      }
    } else if(s[i] == n[2]){
      if(num[2] != 2){
        num++;
      } else {
        cout << "No";
      }
    } else if(n[2] == ''){
      n[2] = s[i];
    } else {
      cout << "No";
    }
  }
  
  cout << "Yes";
}
  

Compiler output:
a.cc:25:23: error: empty character constant
   25 |     } else if(n[2] == ''){
      |                       ^~
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng s;
      |   ^~~~~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i = 1; i < s.size(); i++){
      |       ^
a.cc:15:9: error: lvalue required as increment operand
   15 |         num++;
      |         ^~~
a.cc:21:9: error: lvalue required as increment operand
   21 |         num++;
      |         ^~~
Language: C++

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

int main(){
  stirng s;
  char n[2];
  int num[2];
  cin >> s;
  n[1] = s[1];
  num[1] = 1;
  for(i = 1; i < s.size(); i++){
    if(s[i] == n[1]){
      if(num[1] != 2){
      	num++;
      } else {
        cout << "No";
      }
    } else if(s[i] == n[2]){
      if(num[2] != 2){
        num++;
      } else {
        cout << "No";
      }
    } else if(n[2] == ''){
      n[2] = s[i];
    } else {
      cout << "No";
    }
  }
  
  cout << "Yes";
}
  

Compiler output:
a.cc:2:9: fatal error: stirng: No such file or directory
    2 | #include<stirng>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include<iostrem>
#include<map>
using namespace std;
int main(){
 	string s;
  	cin >> s;
  	map<char,int> m;
  	for(char c:s){
     	m[c]++; 
    }
  	if(m.size()==2){
     	for(pair<int,int>p,m){
         	if(p.second!=2){
             	cout >> "NO" >> endl;
              	return 0;
            }
        }
      	cout << "YES" << endl;
      return 0;
    }
  	cout << "NO" <<endl;
}


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

#include<iostrem>
#include<map>
using namespace std;
int main(){
 	string s;
  	cin >> s;
  	map<string,int> m;
  	for(char c:s){
     	m[c]++; 
    }
  	if(m.size()==2){
     	for(pair<int,int>p,m){
         	if(p.second!=2){
             	cout >> "NO" >> endl;
              	return 0;
            }
        }
      	cout << "YES" << endl;
      return 0;
    }
  	cout << "NO" <<endl;
}

Compiler output:
a.cc:1:9: fatal error: iostrem: No such file or directory
    1 | #include<iostrem>
      |         ^~~~~~~~~
compilation terminated.
Language: Java

mport java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String s = sc.next();
		char[] c = s.toCharArray();

		Arrays.sort(c);
		if(c[0]==c[1]&&c[2]==c[3]&&c[1]!=c[2]) out.println("Yes");
		else out.println("No");

		out.flush();
	}

}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.PrintWriter;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: C++

#include <bits/stdc++.h>

#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

using namespace std;

/**
 * calculate GCD(greatest common divisor)
 * @param a
 * @param b
 * @return
 */
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

/**
 * change minimum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMinimum(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * change maximum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMaximum(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * output answer
 * @tparam T
 * @param answer
 * @return
 */
template<typename T>
T output(T answer) {
    cout << answer << endl;
    return 0;
}

/** ----from here ---------------------------------------------------------- */

int main() {


    string S;
    cin >> S;
    char t, s, temp;
    int count = 0;
    for (int i = 0; i < 4; ++i) {
        temp = S[i];

        if (i == 0) {
            t = S[i];
            continue;
        }
        if (temp == t) {
            count++;
            continue;
        }

        if (s == S[i]) {
            count++;
        } else {
            s = S[i];
        }

    }
    string ans = 'No';
    if (count == 2) {
        ans = 'Yes';
    }
    cout << ans << endl;
}

Compiler output:
a.cc:105:18: warning: multi-character character constant [-Wmultichar]
  105 |     string ans = 'No';
      |                  ^~~~
a.cc:107:15: warning: multi-character character constant [-Wmultichar]
  107 |         ans = 'Yes';
      |               ^~~~~
a.cc: In function 'int main()':
a.cc:105:18: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
  105 |     string ans = 'No';
      |                  ^~~~
a.cc:107:15: warning: overflow in conversion from 'int' to 'char' changes value from '5858675' to '115' [-Woverflow]
  107 |         ans = 'Yes';
      |               ^~~~~
Language: C

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

if(
(str[1]==str[2]&&str[3]==str[4]&&str[1]!=str[3])
||(str[1]==str[3]&&str[2]==str[4]&&str[1]!=str[2])
||(str[1]==str[4]&&str[2]==str[3]&&str[1]!=str[2])
)
printf("Yes");
else
printf("No");

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected declaration specifiers before 'scanf'
    4 | scanf("%s",str);
      | ^~~~~
main.c:6:1: error: expected declaration specifiers before 'if'
    6 | if(
      | ^~
main.c:12:1: error: expected declaration specifiers before 'else'
   12 | else
      | ^~~~
main.c:15:1: error: expected declaration specifiers before 'return'
   15 | return 0;
      | ^~~~~~
main.c:16:1: error: expected declaration specifiers before '}' token
   16 | }
      | ^
main.c:2:5: error: old-style parameter declarations in prototyped function definition
    2 | int main(void)
      |     ^~~~
main.c:17: error: expected '{' at end of input
Language: C++

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

int main()
{
  string str;
  unordered_set<char> s;
  cin>>str;
  int count[4] = {0};
  
  for(int i=0;i<4;i++)
  {
    if(s.find(str[i]) == s.end())
       {
         count[i]++;
         s.insert(str[i]);
       }
    else if(str[i] == str[0])
      count[0]++;
    else if(str[i] == str[1]
      count[1]++;
    else 
      count[2]++;
   }
  
  if(count[0] == 2 && count[1] == 2 || count[0]==2 && count[3]==2)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  
  return 0;
  
}
    
    
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:22:29: error: expected ';' before 'count'
   22 |     else if(str[i] == str[1]
      |                             ^
      |                             ;
   23 |       count[1]++;
      |       ~~~~~                  
a.cc:24:5: error: expected primary-expression before 'else'
   24 |     else
      |     ^~~~
a.cc:23:18: error: expected ')' before 'else'
   23 |       count[1]++;
      |                  ^
      |                  )
   24 |     else
      |     ~~~~          
a.cc:22:12: note: to match this '('
   22 |     else if(str[i] == str[1]
      |            ^
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();

		for(int i=0; i<S.length(); i++) {
			for(int j=0; j<S.length(); j++) {
				if(i==j)continue;
				else {
					if(S.charAt(i)==S.charAt(j)) {
						int k=0;
						int l=0;
						while(k==i | k==j) {
							k++;
						}
						while(l==i | l==j | l==k) {
							l++;
						}
						if(S.charAt(k)==S.charAt(l) && S.charAt(i)!=S.charAt(k)){
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

package A;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();

		for(int i=0; i<S.length(); i++) {
			for(int j=0; j<S.length(); j++) {
				if(i==j)continue;
				else {
					if(S.charAt(i)==S.charAt(j)) {
						int k=0;
						int l=0;
						while(k==i | k==j) {
							k++;
						}
						while(l==i | l==j | l==k) {
							l++;
						}
						if(S.charAt(k)==S.charAt(l) && S.charAt(i)!=S.charAt(k)){
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package A;
      | ^~~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

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

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

    sort(S.begin(), S.end());
    if ((S[0] == S[1]) && (S[1] != S[2]) && (S[2] == S[3]))
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
}
}


Compiler output:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    string s;
    cin >> s;
    //真ん中の2K-N個数部分はすべて0かすべて1とならないといけない
    int len = s.size();
    if(len % 2 == 1) {
        //奇数個
        // cout << "奇数個" << endl;
        int middle = len / 2;
        int i = 1;
        int cnt = 0;
        while(s[middle] == s[middle - i] and s[middle] == s[middle + i]) {
            i++;
            cnt++;
        }
        cout << (2 * cnt + 1 + len) / 2 << endl;
        return 0;
    } else {
        // cout << "偶数個" << endl;
        if(s[len / 2] != s[len / 2 - 1]) {
            cout << N / 2 << endl;
            return 0;
        } else {
            int i = 1;
            int cnt = 0;
            while(s[len / 2] == s[len / 2 + i] and
                  s[len / 2 - 1] == s[len / 2 - 1 - i]) {
                i++;
                cnt++;
            }
            cout << (2 * cnt + 2 + len) / 2 << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:21: error: 'N' was not declared in this scope
   52 |             cout << N / 2 << endl;
      |                     ^
Language: C

#include <stdio.h>

int main()
{
	char input[256];
	scanf("%255s", input);
	char onec = 0;
	char twoc = 0;
	int onen = 0;
	int twon = 0;

	for( int i=0; i < 4; i++ ) {
		if( input[i]==onec ) {
			onen++;
		} else if( input[i]==twoc ) {
			twon++;
		} else if( onec == 0 ) {
			onec = input[i];
			onen++;
		} else if( twoc == 0 ) {
			twoc = input[i];
			twon++;
		}
	}

	if( onen==2 && twon==2 ) {
		printf("Yes\");
	} else {
		printf("No\");
	}

	return 0;

}


Compiler output:
main.c: In function 'main':
main.c:27:24: warning: missing terminating " character
   27 |                 printf("Yes\");
      |                        ^
main.c:27:24: error: missing terminating " character
   27 |                 printf("Yes\");
      |                        ^~~~~~~~
main.c:28:9: error: expected expression before '}' token
   28 |         } else {
      |         ^
main.c:27:24: error: expected ';' before '}' token
   27 |                 printf("Yes\");
      |                        ^
      |                        ;
   28 |         } else {
      |         ~               
main.c:29:24: warning: missing terminating " character
   29 |                 printf("No\");
      |                        ^
main.c:29:24: error: missing terminating " character
   29 |                 printf("No\");
      |                        ^~~~~~~
main.c:30:9: error: expected expression before '}' token
   30 |         }
      |         ^
main.c:29:24: error: expected ';' before '}' token
   29 |                 printf("No\");
      |                        ^
      |                        ;
   30 |         }
      |         ~
Language: C

#include <stdio.h>

int main()
{
	char input[256];
	scanf("%255s", input);
	char onec = 0;
	char twoc = 0;
	int onen = 0;
	int twon = 0;

	for( int i=0; i < 4; i++ ) {
		switch( input[i] ) {
		case onec:
			onen++;
			break;
		case twoc:
			twon++;
			break;
		default:
			if( onec == 0 ) {
				onec = input[i];
				onen++;
			}
			else
			if( twoc == 0 ) {
				twoc = input[i];
				twon++;
			}
			break;
		}
	}

	if( onen==2 && twon==2 ) {
		printf("Yes\");
	} else {
		printf("No\");
	}

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: case label does not reduce to an integer constant
   14 |                 case onec:
      |                 ^~~~
main.c:17:17: error: case label does not reduce to an integer constant
   17 |                 case twoc:
      |                 ^~~~
main.c:35:24: warning: missing terminating " character
   35 |                 printf("Yes\");
      |                        ^
main.c:35:24: error: missing terminating " character
   35 |                 printf("Yes\");
      |                        ^~~~~~~~
main.c:36:9: error: expected expression before '}' token
   36 |         } else {
      |         ^
main.c:35:24: error: expected ';' before '}' token
   35 |                 printf("Yes\");
      |                        ^
      |                        ;
   36 |         } else {
      |         ~               
main.c:37:24: warning: missing terminating " character
   37 |                 printf("No\");
      |                        ^
main.c:37:24: error: missing terminating " character
   37 |                 printf("No\");
      |                        ^~~~~~~
main.c:38:9: error: expected expression before '}' token
   38 |         }
      |         ^
main.c:37:24: error: expected ';' before '}' token
   37 |                 printf("No\");
      |                        ^
      |                        ;
   38 |         }
      |         ~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class A {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        char[] cs = sc.next().toCharArray();
        Arrays.sort(cs);

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

Compiler output:
Main.java:4: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error