criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

public class Fiftyfifty {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.nextLine();
		String b = "No";
		String[] ar = a.split("");

		if(ar[0].equals(ar[1])) {
			if(ar[2].equals(ar[3])){
				b = "Yes";
				System.out.println(b);
			}
		}else if(ar[0].equals(ar[2])) {
			if(ar[1].equals(ar[3])){
				b = "Yes";
				System.out.println(b);
			}
		}else if(ar[0].equals(ar[3])) {
			if(ar[1].equals(ar[2])){
				b = "Yes";
				System.out.println(b);
			}
		}else {
			System.out.println(b);
		}
	}
}

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

import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String S = sc.next();
   if(S.charAt(0)==S.charAt(1)){
     if(S.charAt(2)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(2)){
     if(S.charAt(1)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(3)){
     if(S.charAt(1)==S.charAt(2)){
     System.out.println("Yes");
     }
   }else if(S.charAt(1)==S.charAt(2)){
     if(S.charAt(0)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(1)==S.charAt(3)){
     if(S.charAt(0)==S.charAt(2)){
     System.out.println("Yes");
     }
   }else if(S.charAt(2)==S.charAt(3)){
     if(S.charAt(0)==S.charAt(1)){
     System.out.println("Yes");
     }
   }else{
     System.out.println("No");
   }
  }
 }
}

Compiler output:
Main.java:35: error: class, interface, enum, or record expected
}
^
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[0] == s[2] && s[1] == s[3] || s[0] == s[3] && s[1] == s[2]) {
        cout << "Yes";
    } else {
        cout << "No";
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected primary-expression before '==' token
    7 |     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]) {
      |                             ^~
a.cc:7:100: error: expected ']' before ')' token
    7 |     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]) {
      |                                                                                                    ^
      |                                                                                                    ]
Language: Java

import java.util.Scanner;

public class first {

    //https://atcoder.jp/contests/abc132/tasks/abc132_a
    public static void main( String[] args ) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.next();

        int[] arr = new int[26];
        for (int i = 0; i < 4; i++) {
            arr[str.charAt(i) - 'A']++;
        }

        int type = 0;
        for (int i = 0; i < 26; i++) {

            if (arr[i] > 0 && arr[i] == 2) {
                type++;
            }
        }

        System.out.println(type == 2 ? "Yes" : "No");
    }
}


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

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

int main(){
	int js=0;
	char a[4];
	gets(a);
	for (int i=0;i<strlen(a);i++){
		for(int j=i+1;j < strlen(a);j++){
			if (a[j] == a[i]){
				js++;
			}
		}
	}
	if (js == 2){
		printf("Yes");
	}
	else{
		printf("No");
	}
} 

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(a);
      |         ^~~~
      |         getw
Language: C

#include <stdio.h>

int main (void){
	int bb, cc;
        char a[10], b, c;
	bb=0;
	cc=0;
	scanf("%c",a);
	b=a[0];
	bb++;
	if(b!=a[1]){
		c=a[1];
		cc++;
	}
	else {
		bb++;
	}
	if(b!=a[2] && c!=a[2]){
		b=100;
	}
	else if (b==a[2]){
		b++;
	}
	else if (c==a[2]){
		c++;
	}
        if(b!=a[3] && c!=a[3]){
		breke;
	}
	else if (b==a[3]){
		b++;
	}
	else if (c==a[3]){
		c++;
	}
        if (bb!=2 && cc!= 2){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:17: error: 'breke' undeclared (first use in this function)
   28 |                 breke;
      |                 ^~~~~
main.c:28:17: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.HashSet;
import java.util.List;

class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    Library lib = new Library();
    String S = sc.next();
    HashMap<Character,Integer> map = new HashMap<>();
    for (int i=0;i<4;i++){
        if (map.containsKey(String.valueOf(S.charAt(i)))){
            map.put(S.charAt(i),map.get(S.charAt(i))+1);
        } else {
            map.put(S.charAt(i),1);
        }
    }
    int ans_cnt1 = 0;
    int ans_cnt2 = 0;
    for (Character C:map.keySet()){
        ans_cnt1++;
        if (map.get(C)==2){
            ans_cnt2++;
        }
    }
    if (ans_cnt1==2 && ans_cnt2==2){
        System.out.println("Yes");
    } else {
        System.out.println("No");
    }
}

class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
}

Compiler output:
Main.java:60: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

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

    for (int i = 0; i < s.length(); i++) {
        int cnt = std::count(s.cbegin(), s.cend(), s[i]);
        if (cnt != 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'count' is not a member of 'std'; did you mean 'cout'?
   10 |         int cnt = std::count(s.cbegin(), s.cend(), s[i]);
      |                        ^~~~~
      |                        cout
Language: C++

#include<iostream>
#include<string>

using std

int main(){

	string input_str;
    char c[];
    int a;
    int b;
    
    cout << "input string";
	getline(cin, input_str);
    
    split(c, input_str);
    
    if(c[0] == c[1]){
    	a ++;
    }else if(c[1] == c[2]){
    	a ++;
    }else if(c[2] == c[3]){
    	a ++;
    }else if(c[3] == c[0]){
    	a ++;
    }else if(c[3] == c[1]){
    	a ++;
    }else if(c[2] == c[0]){
    	a ++;
    }
    
    if(a => 2){
    	printf("Yes");
        }else{
        printf("No");
    }
    
    return 0;
    }
    
    
    
    
    
  
  
  

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'std'
    4 | using std
      |       ^~~
Language: C

#include<stdio.h>

int main (void){
	int bb, cc;
        char a[10], b, c;
	bb=0;
	cc=0;
	scanf("%c",a);
	b=a[0];
	bb++;
	if(b!=a[1]){
		c=a[1];
		cc++;
	}
	else {
		bb++;
	}
	if(b!=a[2] && c!=a[2]){
		breke;
	}
	else if (b==a[2]){
		b++;
	}
	else if (c==a[2]){
		c++;
	}
        if(b!=a[3] && c!=a[3]){
		breke;
	}
	else if (b==a[3]){
		b++;
	}
	else if (c==a[3]){
		c++;
	}
        if (bb!=2 && cc!= 2){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:17: error: 'breke' undeclared (first use in this function)
   19 |                 breke;
      |                 ^~~~~
main.c:19:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:46: error: expected ')' before '$$'
    7 |   if(S.at(0) == S.at(1) && S.at(2) == S.at(3) $$ S.at(0) != S.at(2)){
      |     ~                                        ^~~
      |                                              )
a.cc:11:46: error: expected ')' before '$$'
   11 |   if(S.at(0) == S.at(2) && S.at(1) == S.at(3) $$ S.at(0) != S.at(3)){
      |     ~                                        ^~~
      |                                              )
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string S;
  cin >> S;
  char C[4];
  C = S.c_str();
  int cnt = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i != j && C[i] == C[j]) {
        cnt++;
      }
    }
    if (cnt != 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: incompatible types in assignment of 'const char*' to 'char [4]'
    8 |   C = S.c_str();
      |   ~~^~~~~~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'else' without a previous 'if'
    5 |   else 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 x;
  cin>>x;
  int a=x[0],b=x[1],c=[2],d=[3];
  if(a==b,a!=c,c==d){
    cout<<"Yes"<<endl;
  }
  else if(a==c,a!=b,b==d){
    cout<<"Yes"<<endl;
  }
  else if(a==d,a!=c,c==b){
    cout<<"Yes"<<endl;
  }
  else
    cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected identifier before numeric constant
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                        ^
a.cc: In lambda function:
a.cc:6:26: error: expected '{' before ',' token
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                          ^
a.cc: In function 'int main()':
a.cc:6:23: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                       ^~~
a.cc:6:23: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                       ^
a.cc:6:23: note:   no known conversion from 'void (*)()' to 'int'
a.cc:6:30: error: expected identifier before numeric constant
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                              ^
a.cc: In lambda function:
a.cc:6:32: error: expected '{' before ';' token
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                                ^
a.cc: In function 'int main()':
a.cc:6:29: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                             ^~~
a.cc:6:29: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
    6 |   int a=x[0],b=x[1],c=[2],d=[3];
      |                             ^
a.cc:6:29: note:   no known conversion from 'void (*)()' to 'int'
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int c=0,a=0,b=0;
  if(s[0]==s[1])
  {
    c++;
  }
  if(s[0]==s[2])
  {
    c++;
  }
  if(s[0]==s[3])
  {
    c++;
  }
  if(s[1]==s[2])
  {
    a++;
  }
  if(s[1]==s[3])
  {
    a++;
  }
  if(s[2]==s[3])
  {
   b++;
  }
  if(c==1 && b==1)
     {
       cout<<"Yes\n";
     }
     else if((c==1 && a==1)
     {
       cout<<"Yes\n";
     }
      else if((a==1 && b==1)
     {
       cout<<"Yes\n";
     }
     else{
       cout<<"No\n";
       }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:28: error: expected ')' before '{' token
   36 |      else if((c==1 && a==1)
      |             ~              ^
      |                            )
   37 |      {
      |      ~
Language: C

#include<stdio.h>

int main (void){
	int bb, cc;
        char a[10], b, c;
	bb=0;
	cc=0;
	scanf("%s",a);
	b=a[0];
	bb++;
	if(b!=a[1]){
		c=a[1];
		cc++;
	}
	else {
		bb++;
	}
	if(b!=a[2] && c!=a[2]){
		breke;
	}
	else if (b==a[2]){
		b++;
	}
	else if (c==a[2]){
		c++;
	}
        if(b!=a[3] && c!=a[3]){
		breke;
	}
	else if (b==a[3]){
		b++;
	}
	else if (c==a[3]){
		c++;
	}
        if (bb!=2 && cc!= 2){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:17: error: 'breke' undeclared (first use in this function)
   19 |                 breke;
      |                 ^~~~~
main.c:19:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string S;
  cin >> S;
  char C[4] = S.c_str();
  int cnt = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i != j && C[i] == C[j]) {
        cnt++;
      }
    }
    if (cnt != 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: array must be initialized with a brace-enclosed initializer
    7 |   char C[4] = S.c_str();
      |               ~~~~~~~^~
Language: Java

import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String S = sc.next();
   if(S.charAt(0)==S.charAt(1)){
     if(S.charAt(2)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(2)){
     if(S.charAt(1)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(3)){
     if(S.charAt(1)==S.charAt(2)){
     System.out.println("Yes");
   }else if(S.charAt(1)==S.charAt(2)){
     if(S.charAt(0)==S.charAt(3)){
     System.out.println("Yes");
   }else if(S.charAt(1)==S.charAt(3)){
     if(S.charAt(0)==S.charAt(2)){
     System.out.println("Yes");
   }else if(S.charAt(2)==S.charAt(3)){
     if(S.charAt(0)==S.charAt(1)){
     System.out.println("Yes");
   }else{
     System.out.println("No");
   }
  }
 }
}

Compiler output:
Main.java:31: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected ',' or ';' before 'c'
    6 |   int a=x[0],b=x[1]c=[2]d=[3];
      |                    ^
a.cc:7:14: error: 'c' was not declared in this scope
    7 |   if(a==b,a!=c,c==d){
      |              ^
a.cc:7:19: error: 'd' was not declared in this scope
    7 |   if(a==b,a!=c,c==d){
      |                   ^
Language: C++

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

int main(void){
    
   char txt[4] = {}; cin >> txt;
   
   if(txt[0] == txt[1] && txt[1] == txt[2] &&) txt[2] == txt[3]{
       
       cout << "No" << endl;
   }else if{
   
   if(txt[0] == txt[1]){
       
       if(txt[2] == txt [3]){
       
           cout << "Yes" << endl;
       
       }else{
           
           cout << "No" << endl;
       }
   }else if(txt[0] == txt[2]){
       
         if(txt[1] == txt [3]){
           
           cout << "Yes" << endl;
           
       }else{
           
           cout << "No" << endl;
       }
   }else if(txt[0] == txt[3]){
       
         if(txt[1] == txt [2]){
           
           cout << "Yes" << endl;
       }else{
           
           cout << "No" << endl;
       }
   }else{
       cout << "No" << endl;
   }
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:46: error: expected primary-expression before ')' token
    9 |    if(txt[0] == txt[1] && txt[1] == txt[2] &&) txt[2] == txt[3]{
      |                                              ^
a.cc:9:64: error: expected ';' before '{' token
    9 |    if(txt[0] == txt[1] && txt[1] == txt[2] &&) txt[2] == txt[3]{
      |                                                                ^
      |                                                                ;
a.cc:12:12: error: expected '(' before '{' token
   12 |    }else if{
      |            ^
      |            (
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string S;
  cin >> S;
  char C[4] = str.c_str();
  int cnt = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i != j && C[i] == C[j]) {
        cnt++;
      }
    }
    if (cnt != 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |   char C[4] = str.c_str();
      |               ^~~
      |               std
Language: C++

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

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

    for (int i = 0; i < s.length(); i++) {
        int cnt = count(s.cbegin(), s.cend(), s[i]);
        if (cnt != 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'count' was not declared in this scope; did you mean 'cnt'?
   10 |         int cnt = count(s.cbegin(), s.cend(), s[i]);
      |                   ^~~~~
      |                   cnt
Language: C

#include<stdio.h>

int main (void){
	int bb, cc;
        char a[10], b, c;
	bb=0;
	cc=0;
	scanf("%s",a);
	b=a[0];
	bb++;
	if(b!=a[1]){
		c=a[1]
		cc++;
	}
	else {
		bb++;
	}
	if(b!=a[2] && c!=a[2]){
		breke;
	}
	else if (b==a[2]){
		b++;
	}
	else if (c==a[2]){
		c++;
	}
        if(b!=a[3] && c!=a[3]){
		breke;
	}
	else if (b==a[3]){
		b++;
	}
	else if (c==a[3]){
		c++;
	}
        if (bb!=2 && cc!= 2){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:23: error: expected ';' before 'cc'
   12 |                 c=a[1]
      |                       ^
      |                       ;
   13 |                 cc++;
      |                 ~~     
main.c:19:17: error: 'breke' undeclared (first use in this function)
   19 |                 breke;
      |                 ^~~~~
main.c:19:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main (void){
	a
	int bb, cc;
        char a[10], b, c;
	bb=0;
	cc=0;
	scanf("%s",a);
	b=a[0];
	bb++;
	if(b!=a[1]){
		c=a[1]
		cc++;
	}
	else {
		bb++;
	}
	if(b!=a[2] && c!=a[2]){
		breke;
	}
	else if (b==a[2]){
		b++;
	}
	else if (c==a[2]){
		c++;
	}
        if(b!=a[3] && c!=a[3]){
		breke;
	}
	else if (b==a[3]){
		b++;
	}
	else if (c==a[3]){
		c++;
	}
        if (bb!=2 && cc!= 2){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: 'a' undeclared (first use in this function)
    4 |         a
      |         ^
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:10: error: expected ';' before 'int'
    4 |         a
      |          ^
      |          ;
    5 |         int bb, cc;
      |         ~~~
main.c:7:9: error: 'bb' undeclared (first use in this function); did you mean 'b'?
    7 |         bb=0;
      |         ^~
      |         b
main.c:8:9: error: 'cc' undeclared (first use in this function); did you mean 'c'?
    8 |         cc=0;
      |         ^~
      |         c
main.c:13:23: error: expected ';' before 'cc'
   13 |                 c=a[1]
      |                       ^
      |                       ;
   14 |                 cc++;
      |                 ~~     
main.c:20:17: error: 'breke' undeclared (first use in this function)
   20 |                 breke;
      |                 ^~~~~
Language: Java

/*
* @Author: patan
* @Date:   2019-06-29 17:35:14
* @Last Modified by:   patan
* @Last Modified time: 2019-06-29 17:42:59
*/
import java.io.*;
import java.util.*;
 
public class a {

	public static void main(String[] args)throws IOException {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
		String s = in.next();
		int alpha[] = new int[26];
		Arrays.fill(alpha,0);
		for(char c : s.toCharArray())
		{
			alpha[c-'A']++;
		}
		int count = 0;
		for(int i=0;i<26;i++)
		{
			if(alpha[i]==2)
				count++;
		}
		if(count==2)
			out.println("Yes");
		else
			out.println("No");
		out.close();
	}
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }

}

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

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;
bool test( const string& s) {
    if (s.size() != 4) return false;
    char buffer[4];
    copy( s.begin(), s.end(), buffer);
    sort( &buffer[0], &buffer[4]);
    return buffer[0] == buffer[1] && buffer[2] == buffer[3] && buffer[0] != buffer[2];
}

int main(void) {
    string s;
    cin >> s;
    if (test(s)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
}

      

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



#include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
	string S;

	bool is_first_char = false;
	bool is_second_char = false;
	char checker1 = '0';
	char checker2 = '0';
	bool total_flag = true;

	cin >> S;

	for (int i = 0; i < S.length(); i++)
	{
		if (checker1 == '0') {
			checker1 = S[i];
		}

		else if (S[i] == checker1) { ; }

		else if (checker2 == '0')
		{
			checker2 = S[i];
		}


		else if (S[i] == checker2) { ; }

		else if (S[i] != checker1 && S[i] != checker2) {

			total_flag = false;
		}
	}
	if (total_flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

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

include<iostream>
using namespace std;

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

  if (s[0] == s[1] && s[1]== s[2] && s[3] == s[2]){
    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;
  }




  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << "No" << endl;
      |     ^~~~
a.cc:9:21: error: 'endl' was not declared in this scope
    9 |     cout << "No" << endl;
      |                     ^~~~
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:12:22: error: 'endl' was not declared in this scope
   12 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << "No" << endl;
      |     ^~~~
a.cc:14:21: error: 'endl' was not declared in this scope
   14 |     cout << "No" << endl;
      |                     ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

void a()
{
	string s;
	cin >> s;
	int cnt[26];
	memset(cnt, 0, 26*sizeof(int));
	for (int i = 0; i < 4; i++) {
		cnt[s[i] - 'A']++;
	}
	bool res = true;
	for (int i = 0; i < 26; i++) {
		if (cnt[i] != 0 && cnt[i] != 2) {
			res = false;
		}
	}
	cout << (res ? "Yes" : "No") << endl;
}
int main()
{
	a();
}


Compiler output:
a.cc: In function 'void a()':
a.cc:11:9: error: 'memset' was not declared in this scope
   11 |         memset(cnt, 0, 26*sizeof(int));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here
    string s;
    cin>>s;
    int n=0;
    if(s[0]==s[1]){
        n++;
    }
    if(s[2]==s[3]){
        n++;
    }
    if(s[0]==s[3]){
        n++;
    }
    if(s[1]==s[2]){
        n++;
    }
    if(s[0]==s[2]){
        n++;
    }
    if(a[1]==a[3]){
        n++;
    }
    if(n==2){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'a' was not declared in this scope
   23 |     if(a[1]==a[3]){
      |        ^
Language: C

// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
using namespace std;

#include <stdio.h>
#include <iostream>
#include <algorithm>


int main(void) {
	string S;

	bool is_first_char = false;
	bool is_second_char = false;
	char checker1 = '0';
	char checker2 = '0';
	bool total_flag = true;

	cin >> S;

	for (int i = 0; i < S.length(); i++)
	{
		if (checker1 == '0') {
			checker1 = S[i];
		}

		else if (S[i] == checker1) { ; }

		else if (checker2 == '0')
		{
			checker2 = S[i];
		}


		else if (S[i] == checker2) { ; }

		else if (S[i] != checker1 && S[i] != checker2) {

			total_flag = false;
		}
	}
	if (total_flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
main.c:6:10: fatal error: iostream: No such file or directory
    6 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>

int main(void)
{
    char S[5];
    int alpha['Z' - 'A' + 1] = {0};

    gets(S);

    alpha[S[0] - 'A']++;
    alpha[S[1] - 'A']++;
    alpha[S[2] - 'A']++;
    alpha[S[3] - 'A']++;

    int count = 0;
    for (size_t i = 0; i < sizeof(alpha) / sizeof(int); i++) {
        if (alpha[i]) count++;
    }

    if (count != 2) {
        puts("No");
        return 0;
    }

    for (size_t i = 0; i < sizeof(alpha) / sizeof(int); i++) {
        if (alpha[i] == 0) continue;
        if (alpha[i] != 2) {
            puts("No");
            return 0;
        }
    }

    puts("Yes");

    return 0;
}


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

#include <stdio.h>

int main(){
  	char s[4];
  	char x[2];
  	char y[2];
  	int cnt = 0;
  	int j = 0;
  
  	scanf("%s\n",s);
  
  	x[0] = s[0];
  	for(int i = 1; i < 4; i++){
    	if(s[i] == x[0]){
        	cnt++;
        }else{
        	y[j] = s[i];
          	j++;
        }
    }

  	if(cnt == 1 && y[0] == y[1]){
    	prinft("Yes\n");
    }else{
    	prinft("No\n");
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'prinft' was not declared in this scope; did you mean 'printf'?
   23 |         prinft("Yes\n");
      |         ^~~~~~
      |         printf
a.cc:25:9: error: 'prinft' was not declared in this scope; did you mean 'printf'?
   25 |         prinft("No\n");
      |         ^~~~~~
      |         printf
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/

signed main()
{
//	v.resize(n);
string s;cin >> s;
if((s[0] == s[1] && s[2] == s[3]){
	cout << "Yes" << endl;
	
}
else if(s[1] == s[2] && s[0] == s[3]){
	cout << "Yes" << endl;
}
else if(s[1] == s[3] && s[2] == s[0]){
	cout << "Yes" << endl;
}
else{
	cout << "No" << endl;
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:34: error: expected ';' before '{' token
   61 | if((s[0] == s[1] && s[2] == s[3]){
      |                                  ^
      |                                  ;
a.cc:65:1: error: expected primary-expression before 'else'
   65 | else if(s[1] == s[2] && s[0] == s[3]){
      | ^~~~
a.cc:64:2: error: expected ')' before 'else'
   64 | }
      |  ^
      |  )
   65 | else if(s[1] == s[2] && s[0] == s[3]){
      | ~~~~
a.cc:61:3: note: to match this '('
   61 | if((s[0] == s[1] && s[2] == s[3]){
      |   ^
Language: Java

import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String S = sc.nect();
   if(S.charAt(0)==S.charAt(1)){
     if(S.charAt(2)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(2)){
     if(S.charAt(2)==S.charAt(3)){
     System.out.println("Yes");
     }
   }else if(S.charAt(0)==S.charAt(2)){
     if(S.charAt(2)==S.charAt(3)){
     System.out.println("Yes");
   }else{
     System.out.println("No");
   }
  }
 }
}

Compiler output:
Main.java:5: error: cannot find symbol
   String S = sc.nect();
                ^
  symbol:   method nect()
  location: variable sc of type Scanner
1 error
Language: C++

#include<iostream>
#inlcude<string>
using namespace std;
int main(){
    string s;
    cin>>s;
    char a=s[0],b=1;
    int fa=0,fb=0;
    for(int i=1;i<n;i++){
        if(s[i]==a) fa=1;
        if(s[i]==b) fb=1;
        if(b==1&&s[i]!=a) b=s[i];
    }
    if(fa&&fb) cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude<string>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:9:19: error: 'n' was not declared in this scope
    9 |     for(int i=1;i<n;i++){
      |                   ^
Language: C++

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

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

    for (int i = 0; i < s.length(); i++) {
        if (count(s.cbegin(), s.cend(), s[i]) != 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'count' was not declared in this scope
   10 |         if (count(s.cbegin(), s.cend(), s[i]) != 2) {
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()		// begin to end
#define rep(i, begin, end) for (ll i = begin; i < end; i++)				// repeat
#define repr(i, begin, end) for (ll i = end - 1; begin <= i; i--)		// repeat reverse

#endif

int main(void)
{
	string cin >> s;
	vector<ll> v(100);
	
	for(const auto &e: s)
		v[(ll)e]++;
	
	ll count = 0;
    for(const auto &e: v)
    {
    	if(e == 2)
          count++;
    }

  if(count == 4)
	cout << Yes;
  else
    cout << No;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected initializer before '>>' token
   18 |         string cin >> s;
      |                    ^~
a.cc:21:28: error: 's' was not declared in this scope
   21 |         for(const auto &e: s)
      |                            ^
a.cc:32:17: error: 'Yes' was not declared in this scope
   32 |         cout << Yes;
      |                 ^~~
a.cc:34:13: error: 'No' was not declared in this scope
   34 |     cout << No;
      |             ^~
Language: C++

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

Compiler output:
a.cc:4:9: error: cannot declare '::main' to be a global variable
    4 |     int main{
      |         ^~~~
a.cc:5:14: error: expected primary-expression before 'S'
    5 |       string S; cin >> S;
      |              ^
a.cc:5:14: error: expected '}' before 'S'
a.cc:4:13: note: to match this '{'
    4 |     int main{
      |             ^
a.cc:5:17: error: 'cin' does not name a type
    5 |       string S; cin >> S;
      |                 ^~~
a.cc:6:7: error: expected unqualified-id before 'if'
    6 |       if(S[0]!=S[1]&&S[0]!=S[2]&&S[0]!=S[3]){
      |       ^~
a.cc:11:7: error: expected unqualified-id before 'else'
   11 |       else cout << "No" << endl;
      |       ^~~~
a.cc:12:7: error: expected unqualified-id before 'return'
   12 |       return 0;
      |       ^~~~~~
a.cc:13:5: error: expected declaration before '}' token
   13 |     }
      |     ^
Language: Java

import java.util.Scanner;

public class a {
        public static void main(String[] args) {
                Scanner scan = new Scanner(System.in);
                String h = scan.next();
                
    String[] array = h.split("");
    
    for(int i = 0; i < 3; i++) {
      if(array[i].equals(array[i+1])){
        System.out.println("Yes");
        return;
    }
    }

    System.out.println("No");
                
        }
}

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

#include <iostream>
#include <string>
#include <vector>

int a,b,c,d,e,f;
int x;
int i,j;

using namespace std;

int main(void){
	char s[4];
	cin >> s;
	
	char c1 = '\0', c2 = '\0';
	int b1 = 0, b2 = 0;
	
	for(i = 0; i < 4; ++i){
		if(s[i] == c1){
			b1++;
		}else if(s[i] == c2){
			b2++;
		}else{
			if(c1 == '\0'){
				c1 = s[i];
				b1++;
			}else if(c2 == '\0'){
				c2 = s[i];
				b2++;
			}else{
				cout << "No" << endl;
				return 0;
			}
		}
	}
	if(b1 == 2 && b2 == 2){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	
	return 0;
}

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

public class Main {
        public static void main(String[] args) {
                Scanner scan = new Scanner(System.in);
                String h = scan.next();
                
    String[] array = h.split("");
    
    for(int i = 0; i < 3; i++) {
      if(array[i].equals(array[i+1])){
        System.out.println("Yes");
        return;
    }
    }

    System.out.println("No");
                
        }
}

Compiler output:
Main.java:3: error: cannot find symbol
                Scanner scan = new Scanner(System.in);
                ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
                Scanner scan = new Scanner(System.in);
                                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string S; cin >> S;
      |   ^~~~~~
a.cc:4: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:4:10: error: expected '}' before 'S'
    4 |   string S; cin >> S;
      |          ^
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:4:13: error: 'cin' does not name a type
    4 |   string S; cin >> S;
      |             ^~~
a.cc:5:3: error: expected unqualified-id before 'if'
    5 |   if(S[0]!=S[1]&&S[0]!=S[2]&&S[0]!=S[3]){
      |   ^~
a.cc:10:3: error: expected unqualified-id before 'else'
   10 |   else cout << "No" << endl;
      |   ^~~~
a.cc:11:3: error: expected unqualified-id before 'return'
   11 |   return 0;
      |   ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C

#include <stdio.h>

int main(){
	char S[5];
	char s,s2;
	int cou=0,cou2=0,flag=0;;
	scanf("%s",S);
	s=S[0];
	for(int i=0;i<4;i++){
		if(s!=S[i] && flag=0){
			s2=S[i];
			flag++;
		}
		if(s==S[i])cou++;
		else if(s2==S[i])cou2++;
	}

	if(cou==2 && cou2 ==2)printf("Yes\n");
	else printf("No\n");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:35: error: lvalue required as left operand of assignment
   10 |                 if(s!=S[i] && flag=0){
      |                                   ^
Language: Java

import scala.io.{StdIn => in}
import scala.collection.{mutable => mu}

object Main extends App {
  val s = in.readLine
  val set = s.toSet
  val ans = if(set.size == 2 &&
   s.count(_ == set.head) == 2 &&
   s.count(_ == set.last) == 2) "Yes" else "No"

  println(ans)
}

Compiler output:
Main.java:1: error: <identifier> expected
import scala.io.{StdIn => in}
                ^
Main.java:2: error: <identifier> expected
import scala.collection.{mutable => mu}
                        ^
2 errors
Language: C++

#include "pch.h"
#include "bits/stdc++.h"

typedef long long ll;
typedef long long int lli;
const int MOD = 1000000007;
#define rep(i,n) for (int i = 0; i < (n); i++)

using namespace std;

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

	string S; cin >> S;

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

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

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

Compiler output:
a.cc:2:5: error: cannot declare '::main' to be a global variable
    2 | int main{
      |     ^~~~
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S; cin >> S;
      |   ^~~~~~
a.cc:3: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:3:10: error: expected '}' before 'S'
    3 |   string S; cin >> S;
      |          ^
a.cc:2:9: note: to match this '{'
    2 | int main{
      |         ^
a.cc:3:13: error: 'cin' does not name a type
    3 |   string S; cin >> S;
      |             ^~~
a.cc:4:3: error: expected unqualified-id before 'if'
    4 |   if(S[0]!=S[1]&&S[0]!=S[2]&&S[0]!=S[3]){
      |   ^~
a.cc:9:3: error: expected unqualified-id before 'else'
    9 |   else cout << "No" << endl;
      |   ^~~~
a.cc:10:3: error: expected unqualified-id before 'return'
   10 |   return 0;
      |   ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <bitset>

using namespace std;
typedef long long ll;

int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);


    ll ans=0;
    ll anss =0;
    ll count=0;
    ll i,j;
  
    ll K;
    vector<ll> a;

    ll Q,N;
    string S;
    cin>>S;
    ll flag=0;
    ll t1=0;
    ll t2=0;
    if(S[0]==S[1]&&S[0]==S[2]){
         cout<< "Yes" << endl;
            return 0;
    }
        if(S[0]==S[1]){
            if(S[2]==S[3]){
                
            cout<< "Yes" << endl;
            return 0;
            }
        }
    if(S[0]==S[2]){
            if(S[1]==S[3]){
            cout<< "Yes" << endl;
            return 0;
            }
        }if(S[0]==S[3]){
            if(S[2]==S[1]){
            cout<< "Yes" << endl;
            return 0;
            }
        }

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

int main(){
  string s;
  char c1,c2;
  int i1,i2=0;
  cin>>s;
  c1=s[0];
  i1=1;
  bool f=0;
  for(int i=1;i<4;i++){
    if(c1==s[i]) i1++;
    else if(f==0){
      c2=s[i];
      f=1;
      i2++;
    }
    else if(c2==s[i]) i2++;
  }
  if(i1==2&&i2==2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'string' was not declared in this scope
    2 |   string s;
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>s;
      |   ^~~
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:18:20: error: 'cout' was not declared in this scope
   18 |   if(i1==2&&i2==2) cout<<"Yes"<<endl;
      |                    ^~~~
a.cc:18:33: error: 'endl' was not declared in this scope
   18 |   if(i1==2&&i2==2) cout<<"Yes"<<endl;
      |                                 ^~~~
a.cc:19:8: error: 'cout' was not declared in this scope
   19 |   else cout<<"No"<<endl;
      |        ^~~~
a.cc:19:20: error: 'endl' was not declared in this scope
   19 |   else cout<<"No"<<endl;
      |                    ^~~~
Language: Java

								//package Dynamic;
import java.io.*;
import java.util.*;
public class abc 
{
    static public void main(String[] args) throws IOException 
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        //int n=Integer.parseInt(br.readLine());
        //int ar[]=new int[n];
//        StringTokenizer st=new StringTokenizer(br.readLine());
//        int a=Integer.parseInt(st.nextToken());
//        int b=Integer.parseInt(st.nextToken());
//        int c=Integer.parseInt(st.nextToken());
        //int d=Integer.parseInt(st.nextToken());
//        int i=0;
//        while(st.hasMoreTokens())
//        {
//        	ar[i++]=st.nextToken();
//        }
        //System.out.println();
//        for(int x=0;x<n;x++)
//        {
//        	
//        }
        
        String s=br.readLine();
        char ch[]=s.toCharArray();
        Arrays.sort(ch);
        s=new String(ch);
        if((s.charAt(0)==s.charAt(1))&&(s.charAt(2)==s.charAt(3))&&s.charAt(0)!=s.charAt(2))
        	System.out.println("Yes");
        else
        	System.out.println("No");
    }
}


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

#include <iostream>
using namespace std;

int main(){
	char s[4];
	cin >> s;
	sort(s, s+4);
	if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
		cout << "Yes" << endl;
	else cout << "No" << endl;
}


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(s, s+4);
      |         ^~~~
      |         short