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

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

int main() {
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	char c;
	int a=0,b=0;
	char aa=0,bb=0;
	for(int i=0;i<4;i++) {
		c=getchar();
		if(aa==0) {a++;aa=c;}
		else if(aa==c) a++;
		else if(bb==0) {b++;bb=c;}
		else if(bb==c) b++;
		else {cout<<"No"<<endl;return 0;}
	}
	if(a==2 && b==2) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}#include<bits/stdc++.h>
using namespace std;
#define debug 1

int main() {
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	char c;
	int a=0,b=0;
	char aa=0,bb=0;
	for(int i=0;i<4;i++) {
		c=getchar();
		if(aa==0) {a++;aa=c;}
		else if(aa==c) a++;
		else if(bb==0) {b++;bb=c;}
		else if(bb==c) b++;
		else {cout<<"No"<<endl;return 0;}
	}
	if(a==2 && b==2) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Compiler output:
a.cc:22:2: error: stray '#' in program
   22 | }#include<bits/stdc++.h>
      |  ^
a.cc:22:3: error: 'include' does not name a type
   22 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C

#include<stdio.h>
int main(void)
{
    char a[5] ;
    scanf("%s",a);
    
    if(a[0]==a[1] && a[2]==[3] && a[0]!=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[2]==a[1] && a[0]!=a[2])
    {printf("Yes");}else{printf("No");}
    return 0;
    }


Compiler output:
main.c: In function 'main':
main.c:7:28: error: expected expression before '[' token
    7 |     if(a[0]==a[1] && a[2]==[3] && a[0]!=a[2])
      |                            ^
main.c:9:23: error: lvalue required as left operand of assignment
    9 |     a[0]==a[2] && a[1]=a[3] && a[0]!=a[1])
      |                       ^
Language: C++

  #include<iostream>
  #include<string>

  using namespace std;

  int main(){

      string in_str;	
      getline(cin, in_str);

      string a = in_str[0];
    string b = in_str[1];
    string c = in_str[2];
    string d = in_str[3];

    int aw = 0;
    if(a == b){
      aw ++;
    }else if(a == c){
      aw ++;
    }else if(a == d){
      aw ++;
    }if(a == ){
      aw ++;
    }

    if(aw == 2){

      printf("Yes");
    }else{
      printf("No");
    }

      return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   11 |       string a = in_str[0];
      |                          ^
a.cc:12:24: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   12 |     string b = in_str[1];
      |                        ^
a.cc:13:24: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |     string c = in_str[2];
      |                        ^
a.cc:14:24: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   14 |     string d = in_str[3];
      |                        ^
a.cc:23:14: error: expected primary-expression before ')' token
   23 |     }if(a == ){
      |              ^
Language: C++

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

int main(){
  string s;
  cin>>s;
  bool ans=false;
  if(s.at(0)==s.at(1)){
    if(s.at(2)==s.at(3)){
      if(s.at(0)!=s.at(2)){
        ans=true;
      }
    }
  }
  else if(s.at(1)==s.at(2)){
    if(s.at(0)==s.at(3)){
      if(s.at(0)!=s.at(1)){
        ans=true;
      }
    }
  }
  else if(s.at(2)==s.at(3)){
    if(s.at(0)==s.at(1)){
      if(s.at(0)!=a.at(2)){
        ans=true;
      }
    }
  }
  if(ans){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No" <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:19: error: 'a' was not declared in this scope
   25 |       if(s.at(0)!=a.at(2)){
      |                   ^
Language: Java


import java.util.*;
import org.omg.CORBA.SystemException;
  class main{

    public static void Main(String[] args){
      String[] a;
      a = new String[4];

      for(int i=0;i<=3;i++){
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        a[i]=n;
      }
      int q=0;
      int z=0;
      for(int f=0;f<=0;f++){
        if(a[f]==a[0]){
        System.out.print("Yes");
        break;
        }else if(a[f]==a[1]){
        System.out.print("Yes");
        break;
        }else if(a[f]==a[2]){
        System.out.print("Yes");
        break;
        }else if(a[f]==a[3]){
        System.out.print("Yes");
        break;
        }else{
        System.out.print("No");
        break;
      }
     }
  }
}


Compiler output:
Main.java:3: error: package org.omg.CORBA does not exist
import org.omg.CORBA.SystemException;
                    ^
1 error
Language: C++

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

int main() {
    string s;
    cin >> s;
    char c1 = s[0];
    char c2 = s[1];
    char c3 = s[2];
    char c4 = s[3];
    if(c1 == c2 && c3 == c4){
        cout << "Yes";
    } else {
        if(c1 == c3 && c2 == c4) 
            cout << "Yes";
        } else {
            if(c1 == c4 && c2 == c3) 
                cout << "Yes";
        } else {
            cout << "No";
        }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'else' without a previous 'if'
   16 |         } else {
      |           ^~~~
a.cc:19:11: error: 'else' without a previous 'if'
   19 |         } else {
      |           ^~~~
Language: C++

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


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

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

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

  string result = "No";

  if (S[0] == S[1] && S[2] == S[3])
    result = "Yes";
  if (S[0] == S[2] && S[1] == S[3])
    result = "Yes";
  if (S[0] == S[3] && S[1] == S[2])
    result = "Yes";
  
  if (S[0] == S[1] &&
      S[0] == S[2] &&
      S[0] == S[3]) {
    result = "No"
  }

  cout << result << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: expected ';' before '}' token
   21 |     result = "No"
      |                  ^
      |                  ;
   22 |   }
      |   ~
Language: C

#define _CRT_SECURE_NO_WARNINGS

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

int main() {
	char S[5];
	int s[5];
	bool flag = true;

	gets_s(S,5);
	for (int i = 0; i < 4; i++) s[i] = (int)S[i];
	for (int i = 0; i < 3; i++) {
		if (s[0] == s[i+1]) {
			s[0] = 0;
			s[i+1] = 0;
			break;
		}
	}
	if (s[1] != 0) {
		for (int i = 0; i < 2; i++) {
			if (s[1] == s[i+2]) {
				s[1] = 0;
				s[i+2] = 0;
				break;
			}
		}
	}
	if (s[2] != 0) {
		if (s[2] == s[3]) {
			s[2] = 0;
			s[3] = 0;
		}
	}
	for (int i = 0; i < 4; i++) {
		if (s[i] != 0) {
			flag = false;
		}
	}

	printf("%s\n", flag? "Yes":"No");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
   13 |         gets_s(S,5);
      |         ^~~~~~
Language: C++

#include <iostream>

using namespace std;
string s;
int main()
{
    cin >> s;
    for(int i = 0; i < 4; i++){
        for(int j = i + 1; j < 4; j++){
            if(s[i] == s[j]){
                cnt++;
            }
        }
        if(cnt == 1){
            cout << "Yes";
            break;
        }else{
            cout << "No";
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:14:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |         if(cnt == 1){
      |            ^~~
      |            int
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'Yes' was not declared in this scope
   11 |       cout << Yes << endl;
      |               ^~~
a.cc:14:14: error: 'No' was not declared in this scope
   14 |      cout << No << endl;
      |              ^~
a.cc:17:15: error: 'Yes' was not declared in this scope
   17 |       cout << Yes << endl;
      |               ^~~
a.cc:20:14: error: 'No' was not declared in this scope
   20 |      cout << No << endl;
      |              ^~
a.cc:23:15: error: 'Yes' was not declared in this scope
   23 |       cout << Yes << endl;
      |               ^~~
a.cc:26:14: error: 'No' was not declared in this scope
   26 |      cout << No << endl;
      |              ^~
Language: C++

#define _CRT_NO_SECURE_WARNINGS
#include <stdio.h>
#include <iostream>

using namespace std;


int main()
{
	
	char a[5];
	char b[5];
	gets(a);
	
	int count1 = 0, count2 = 0;

	for (int i = 0; i < 3; i++)
	{			
		if (a[0] == a[i+1])
		{
			count1++;			
		}
		else
		{			
			if (b[0] == a[i + 1])
			{
				count2++;
			}
			b[0] = a[i + 1];
		}
		
	}
	if (count1 == 1 && count2 == 1) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }


}

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

#include<stdio.h>
int main(){
  int a;
  char s[5];
  // 整数の入力
  scanf("%s", s);
  if((s[0]==s[1]) && (s[2]==s[3]) && (s[1]!=s[2])){
    printf("Yes");
  }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
    printf("Yes");
  }elseif((s[0]==s[3]) && (s[1]==s[2]) && (s[0]!=s[1])){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:4: error: implicit declaration of function 'elseif' [-Wimplicit-function-declaration]
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |    ^~~~~~
main.c:9:56: error: expected ';' before '{' token
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |                                                        ^
      |                                                        ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before 'cmt'
   12 |         if(S[i]==S[j]
      |                      ^
      |                      ;
   13 |            cmt++;
      |            ~~~        
a.cc:14:10: error: expected primary-expression before '}' token
   14 |          }
      |          ^
a.cc:13:18: error: expected ')' before '}' token
   13 |            cmt++;
      |                  ^
      |                  )
   14 |          }
      |          ~        
a.cc:12:11: note: to match this '('
   12 |         if(S[i]==S[j]
      |           ^
a.cc:14:10: error: expected primary-expression before '}' token
   14 |          }
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  char b=s.at(0)
    char c=s.at(1)
    char d=s.at(2)
    char e=s.at(3)
  if(b==c&&d==e)
    cout<<"Yes";
    else if(b==d&&c==e)
    cout<<"Yes";
    else if(b==e&&c==d)
    cout<<"Yes";
  else
    cout<<"No";
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected ',' or ';' before 'char'
    7 |     char c=s.at(1)
      |     ^~~~
a.cc:12:5: error: 'else' without a previous 'if'
   12 |     else if(b==d&&c==e)
      |     ^~~~
a.cc:12:16: error: 'd' was not declared in this scope
   12 |     else if(b==d&&c==e)
      |                ^
a.cc:12:19: error: 'c' was not declared in this scope
   12 |     else if(b==d&&c==e)
      |                   ^
a.cc:12:22: error: 'e' was not declared in this scope
   12 |     else if(b==d&&c==e)
      |                      ^
Language: C++

#define _CRT_NO_SECURE_WARNINGS
#include <stdio.h>
#include <iostream>

using namespace std;


int main()
{
	
	char a[5];
	char b[5];
	gets_s(a);
	
	int count1 = 0, count2 = 0;

	for (int i = 0; i < 3; i++)
	{			
		if (a[0] == a[i+1])
		{
			count1++;			
		}
		else
		{			
			if (b[0] == a[i + 1])
			{
				count2++;
			}
			b[0] = a[i + 1];
		}
		
	}
	if (count1 == 1 && count2 == 1) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'gets_s' was not declared in this scope
   13 |         gets_s(a);
      |         ^~~~~~
Language: C

#include<stdio.h>
int main(){
  int a;
  char s[5];
  // 整数の入力
  scanf("%s", &s);
  if((s[0]==s[1]) && (s[2]==s[3]) && (s[1]!=s[2])){
    printf("Yes");
  }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
    printf("Yes");
  }elseif((s[0]==s[3]) && (s[1]==s[2]) && (s[0]!=s[1])){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:4: error: implicit declaration of function 'elseif' [-Wimplicit-function-declaration]
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |    ^~~~~~
main.c:9:56: error: expected ';' before '{' token
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |                                                        ^
      |                                                        ;
Language: C++

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

int main(){
  char w,x,y,z;
  cin >> w >> x >> y >> z;

  for(int i;i<1;i++){
    if(w==x&&x==y&&y==z){
      cout << "No" << endl;
      break;
    }
    if(w==x&&y==z){
      cout << "Yes" << endl;
      break;
    }
    if(w==z&&x==z){
      cout << "Yes" << endl;
      break;
    }
    if(w==y&&x==z){
      cout << "Yes" << endl;
      break;
    }
  }
  cout << "No" << endl;
}

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

#include<iostream>
#include<bits/stdc++.h>
int b[27];
int main()
{
	char a[5];
	gets(a);
	for(int i = 0 ; i < 4; i++){
		b[a[i] - 'A']++;	
	}
	for(int i = 0; i < 26; i++){
		if(b[i] == 1){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

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 <iostream>

using namespace std;


int main()
{
	
	char a[5];
	char b[5];
	gets_s(a);
	
	int count1 = 0, count2 = 0;

	for (int i = 0; i < 3; i++)
	{			
		if (a[0] == a[i+1])
		{
			count1++;			
		}
		else
		{			
			if (b[0] == a[i + 1])
			{
				count2++;
			}
			b[0] = a[i + 1];
		}
		
	}
	if (count1 == 1 && count2 == 1) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'gets_s' was not declared in this scope
   11 |         gets_s(a);
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin >> s;
	set<char> p;
	for (int i = 0; i < 4; i ++) p.push_back(s[i]);
	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])) && p.size() != 1) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: 'class std::set<char>' has no member named 'push_back'
    7 |         for (int i = 0; i < 4; i ++) p.push_back(s[i]);
      |                                        ^~~~~~~~~
Language: C++

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

long long int rReturn(long long int a)
{
	cin >> a;
	return a;
}

int main()
{
	//string str;
	char a[5];
	char b[5];
	gets_s(a);
	/*cout << a[0] << endl;
	cout << a[1] << endl;
	cout << a[2] << endl;
	cout << a[3] << endl;
	*/
	int count1 = 0, count2 = 0;
	/*
	for (int i = 0; i < 4; i++)
	{
		
		for (int j = i+1; j < 4; j++)
		{
			if (a[i] == a[j])
			{
				count1++;
				b[0] = a[j];
			}
			else count2++;
			
		}
	}
	*/
	for (int i = 0; i < 3; i++)
	{			
		if (a[0] == a[i+1])
		{
			count1++;			
		}
		else
		{			
			if (b[0] == a[i + 1])
			{
				count2++;
			}
			b[0] = a[i + 1];
		}
		
	}
	//cout << count1 << " " << count2 << endl;


	if (count1 == 1 && count2 == 1) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'gets_s' was not declared in this scope
   16 |         gets_s(a);
      |         ^~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: expected ';' before 'false'
   30 |     result false;
      |           ^~~~~~
      |           ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'string' was not declared in this scope
    3 |     string S;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> S;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:4:12: error: 'S' was not declared in this scope
    4 |     cin >> S;
      |            ^
a.cc:7:6: error: 'cout' was not declared in this scope
    7 |     {cout << "Yes" << endl;}
      |      ^~~~
a.cc:7:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:23: error: 'endl' was not declared in this scope
    7 |     {cout << "Yes" << endl;}
      |                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:10:6: error: 'cout' was not declared in this scope
   10 |     {cout << "Yes" << endl;}
      |      ^~~~
a.cc:10:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:23: error: 'endl' was not declared in this scope
   10 |     {cout << "Yes" << endl;}
      |                       ^~~~
a.cc:10:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:6: error: 'cout' was not declared in this scope
   13 |     {cout << "Yes" << endl;}
      |      ^~~~
a.cc:13:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:23: error: 'endl' was not declared in this scope
   13 |     {cout << "Yes" << endl;}
      |                       ^~~~
a.cc:13:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:15:11: error: 'cout' was not declared in this scope
   15 |     else {cout << "No" << endl;}
      |           ^~~~
a.cc:15:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:27: error: 'endl' was not declared in this scope
   15 |     else {cout << "No" << endl;}
      |                           ^~~~
a.cc:15:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

long long int rReturn(long long int a)
{
	cin >> a;
	return a;
}

int main()
{
	//string str;
	char a[5];
	char b[5];
	gets_s(a);
	/*cout << a[0] << endl;
	cout << a[1] << endl;
	cout << a[2] << endl;
	cout << a[3] << endl;
	*/
	int count1 = 0, count2 = 0;
	/*
	for (int i = 0; i < 4; i++)
	{
		
		for (int j = i+1; j < 4; j++)
		{
			if (a[i] == a[j])
			{
				count1++;
				b[0] = a[j];
			}
			else count2++;
			
		}
	}
	*/
	for (int i = 0; i < 3; i++)
	{			
		if (a[0] == a[i+1])
		{
			count1++;			
		}
		else
		{			
			if (b[0] == a[i + 1])
			{
				count2++;
			}
			b[0] = a[i + 1];
		}
		
	}
	//cout << count1 << " " << count2 << endl;


	if (count1 == 1 && count2 == 1) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }


}

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

S = str(input())

out = dict()
for s in S:
	if s in list(out.keys()):
		out[s] += 1
    else:
		out[s] = 1

if (len(list(out.keys())) == 2) and ([out[key] for key in out.keys()] == [2,2]):
	print("Yes")
else:
	print("No")


Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = str(input())
      | ^
Language: C

#include<stdio.h>
int main(){
  int a;
  char s[5];
  // 整数の入力
  scanf("%s", &a);
  if((s[0]==s[1]) && (s[2]==s[3]) && (s[1]!=s[2])){
    printf("Yes");
  }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
    printf("Yes");
  }elseif((s[0]==s[3]) && (s[1]==s[2]) && (s[0]!=s[1])){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:4: error: implicit declaration of function 'elseif' [-Wimplicit-function-declaration]
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |    ^~~~~~
main.c:9:56: error: expected ';' before '{' token
    9 |   }elseif((s[0]==s[2]) && (s[1]==s[3]) && (s[0]!=s[1])){
      |                                                        ^
      |                                                        ;
Language: C++

#include <stdio.h>
#include <string>
#include <iostream>
using std::cin;
using std::string;


	string s;

	cin >> s;

	switch (s[0], s[1], s[2], s[3]) {
	case s[0]==s[1],s[2]==s[3],s[0]!=s[2]:
		printf("Yes");
		break;
	case s[0]==s[2],s[1]==s[3],s[0]!=s[1]:
		printf("Yes");
		break;
	case s[0]==s[3],s[1]==s[2],s[0]!=s[1]:
		printf("Yes");
		break;
	default:
		printf("No");
	}

Compiler output:
a.cc:10:9: error: 'cin' does not name a type
   10 |         cin >> s;
      |         ^~~
a.cc:12:9: error: expected unqualified-id before 'switch'
   12 |         switch (s[0], s[1], s[2], s[3]) {
      |         ^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: expected ')' before 'S'
   21 |         if (S.at(1) == S.at(3) S.at(3)!=S.at(0))
      |            ~                  ^~
      |                               )
a.cc:32:31: error: expected ')' before 'S'
   32 |         if (S.at(1) == S.at(2) S.at(2)!=S.at(0))
      |            ~                  ^~
      |                               )
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	char s[10];
	int count,i,j;
	gets(s);
	for(i=0;i<4;i++)
	{
		count=0;
		for(j=0;j<4;j++)
		{
			if(s[i]==s[j])
			{
				count++;
			}
	    }
	    	if(count!=2)
			{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         gets(s);
      |         ^~~~
      |         getw
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:30: 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:37: 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: C

#include <stdio.h>

int i, j;
	char str[5];
	int sum = 0;
	scanf("%s", str, 5);

	/*if (str[0] == str[1] && str[0] == str[2] || str[0] == str[2] && str[0] == str[3]) {
		printf("Yes\n");
	}else printf("No\n");*/

	for (i = 0; i < 4; i++) {
		sum += str[i];
	}

	if(str[0]+str[1]==sum/2||str[0]+str[2]==sum/2||str[0]+str[3]==sum/2){
		printf("Yes\n");
}
else printf("No\n"); 

	printf("%s", str);
	printf("%d\n", sum);
	printf("%d %d %d", str[0],str[1],sum/2);


Compiler output:
main.c:6:15: error: expected declaration specifiers or '...' before string constant
    6 |         scanf("%s", str, 5);
      |               ^~~~
main.c:6:21: error: expected declaration specifiers or '...' before 'str'
    6 |         scanf("%s", str, 5);
      |                     ^~~
main.c:6:26: error: expected declaration specifiers or '...' before numeric constant
    6 |         scanf("%s", str, 5);
      |                          ^
main.c:12:9: error: expected identifier or '(' before 'for'
   12 |         for (i = 0; i < 4; i++) {
      |         ^~~
main.c:12:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for (i = 0; i < 4; i++) {
      |                       ^
main.c:12:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   12 |         for (i = 0; i < 4; i++) {
      |                             ^~
main.c:16:9: error: expected identifier or '(' before 'if'
   16 |         if(str[0]+str[1]==sum/2||str[0]+str[2]==sum/2||str[0]+str[3]==sum/2){
      |         ^~
main.c:19:1: error: expected identifier or '(' before 'else'
   19 | else printf("No\n");
      | ^~~~
main.c:21:16: error: expected declaration specifiers or '...' before string constant
   21 |         printf("%s", str);
      |                ^~~~
main.c:21:22: error: expected declaration specifiers or '...' before 'str'
   21 |         printf("%s", str);
      |                      ^~~
main.c:22:16: error: expected declaration specifiers or '...' before string constant
   22 |         printf("%d\n", sum);
      |                ^~~~~~
main.c:22:24: error: expected declaration specifiers or '...' before 'sum'
   22 |         printf("%d\n", sum);
      |                        ^~~
main.c:23:16: error: expected declaration specifiers or '...' before string constant
   23 |         printf("%d %d %d", str[0],str[1],sum/2);
      |                ^~~~~~~~~~
main.c:23:28: error: expected declaration specifiers or '...' before 'str'
   23 |         printf("%d %d %d", str[0],str[1],sum/2);
      |                            ^~~
main.c:23:35: error: expected declaration specifiers or '...' before 'str'
   23 |         printf("%d %d %d", str[0],str[1],sum/2);
      |                                   ^~~
main.c:23:42: error: expected declaration specifiers or '...' before 'sum'
   23 |         printf("%d %d %d", str[0],str[1],sum/2);
      |                                          ^~~
Language: C++

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

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


Compiler output:
a.cc:21:1: error: expected unqualified-id before 'else'
   21 | else if(A==C){
      | ^~~~
a.cc:29:1: error: expected unqualified-id before 'else'
   29 | else if(A==D){
      | ^~~~
a.cc:37:1: error: expected unqualified-id before 'else'
   37 | else{
      | ^~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

include<iostream>
using namespace std;

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

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




  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:11:5: error: 'cout' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "No" << endl;
      |     ^~~~
a.cc:13:21: error: 'endl' was not declared in this scope
   13 |     cout << "No" << endl;
      |                     ^~~~
Language: C++

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

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


Compiler output:
a.cc:21:1: error: expected unqualified-id before 'else'
   21 | else if(A==C){
      | ^~~~
a.cc:29:1: error: expected unqualified-id before 'else'
   29 | else if(A==D){
      | ^~~~
a.cc:37:1: error: expected unqualified-id before 'else'
   37 | else{
      | ^~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

include<iostream>
using namespace std;

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

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




  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:11:5: error: 'cout' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "No" << endl;
      |     ^~~~
a.cc:13:21: error: 'endl' was not declared in this scope
   13 |     cout << "No" << endl;
      |                     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  char str[4] ;
  int i1 = 0;
  cin >> str ;
  if ( str[1] == str [2] ){
    int i1 ++;
  }
  if ( str[1] == str [3] ){
    int i1 ++;
  }
  if ( str[1] == str [4] ){
    int i1 ++;
  }
  if ( str[2] == str [3] ){
    int i1 ++;
  }
  if ( str[2] == str [4] ){
    int i1 ++;
  }
  if ( str[3] == str [4] ){
    int i1 ++;
  }
  if ( i1 == 2 ){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected initializer before '++' token
    8 |     int i1 ++;
      |            ^~
a.cc:11:12: error: expected initializer before '++' token
   11 |     int i1 ++;
      |            ^~
a.cc:14:12: error: expected initializer before '++' token
   14 |     int i1 ++;
      |            ^~
a.cc:17:12: error: expected initializer before '++' token
   17 |     int i1 ++;
      |            ^~
a.cc:20:12: error: expected initializer before '++' token
   20 |     int i1 ++;
      |            ^~
a.cc:23:12: error: expected initializer before '++' token
   23 |     int i1 ++;
      |            ^~
Language: Java

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

Compiler output:
Main.java:22: error: non-static method fiftyfifty(String) cannot be referenced from a static context
		String output = fiftyfifty(S);
		                ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main(){
  char str[4] ;
  int i1 ;
  cin >> str ;
  if ( str[1] == str [2] ){
    int i1 ++;
  }
  if ( str[1] == str [3] ){
    int i1 ++;
  }
  if ( str[1] == str [4] ){
    int i1 ++;
  }
  if ( str[2] == str [3] ){
    int i1 ++;
  }
  if ( str[2] == str [4] ){
    int i1 ++;
  }
  if ( str[3] == str [4] ){
    int i1 ++;
  }
  if ( i1 == 2 ){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected initializer before '++' token
    8 |     int i1 ++;
      |            ^~
a.cc:11:12: error: expected initializer before '++' token
   11 |     int i1 ++;
      |            ^~
a.cc:14:12: error: expected initializer before '++' token
   14 |     int i1 ++;
      |            ^~
a.cc:17:12: error: expected initializer before '++' token
   17 |     int i1 ++;
      |            ^~
a.cc:20:12: error: expected initializer before '++' token
   20 |     int i1 ++;
      |            ^~
a.cc:23:12: error: expected initializer before '++' token
   23 |     int i1 ++;
      |            ^~
Language: C++

#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=0;i<b;i++)
#define REP(i,a,b) for(int i=0;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout <<(f?"Yes":"No")<<endl//fが真の場合Yesを出力、偽の場合Noを出力
#define yes(f) cout <<(f?"yes":"no")<<endl
#define YES(f) cout <<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())

using namespace std;

const int mod=1e9+7;

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

    vi num(4,0);

    rep(i,4)
    {
        for(int j=i+1;j<4;j++)
        {
            num[i]=1;
            if(s[i]==s[j])
            {
                num[j]=1;
                if(num[0]&&num[1])
                {
                    if(s[2]==s[3])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                if(num[1]&&num[2])
                {
                    
                    if(s[0]==s[3])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                if(num[2]&&num[3])
                {
                    
                    if(s[1]==s[0])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                if(num[3]&&num[0])
                {
                    
                    if(s[2]==s[1])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                if(num[0]&&num[2])
                {
                    
                    if(s[1]==s[3])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                if(num[1]&&num[3])
                {
                    
                    if(s[2]==s[0])
                    {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
                num[j]=0;
            }
            num[i]=0;
        }  
    }
    cout << "No" << endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   35 |         return;
      |         ^~~~~~
Language: C++

#include<stdio.h>
int main()
{
	int k=0;
	char s[5],a1=' ',a2=' ';
	gets(s);
	a1=s[0];
	for(int i=1;i<4;i++)
	{
		if(s[i]!=a1)
		{
			a2=s[i];
			k=i+1;
			break;
		}
	}
	if(a2==' ')
	{
		printf("No");
		return 0;
	}
	for(int i=k;i<4;i++)
	{
		if(s[i]!=a1&&s[i]!=a2)
		{
			printf("No");
			return 0;
		}
	}
	printf("Yes");
}

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

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

#define rep (i, n) for (int i = 0; i < n; i++)

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'i' was not declared in this scope
    4 | #define rep (i, n) for (int i = 0; i < n; i++)
      |              ^
a.cc:8:9: note: in expansion of macro 'rep'
    8 |         rep(i, 4) cin >> s[i];
      |         ^~~
a.cc:4:17: error: 'n' was not declared in this scope
    4 | #define rep (i, n) for (int i = 0; i < n; i++)
      |                 ^
a.cc:8:9: note: in expansion of macro 'rep'
    8 |         rep(i, 4) cin >> s[i];
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  char str[4] ;
  int i1 ;
  cin >> str ;
  if ( str[1] == str [2] ){
    int i1++;
  }
  if ( str[1] == str [3] ){
    int i1++;
  }
  if ( str[1] == str [4] ){
    int i1++;
  }
  if ( str[2] == str [3] ){
    int i1++;
  }
  if ( str[2] == str [4] ){
    int i1++;
  }
  if ( str[3] == str [4] ){
    int i1++;
  }
  if ( i1 == 2 ){
    cout << Yes << endl;
  }
  else {
    cout << No << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected initializer before '++' token
    8 |     int i1++;
      |           ^~
a.cc:11:11: error: expected initializer before '++' token
   11 |     int i1++;
      |           ^~
a.cc:14:11: error: expected initializer before '++' token
   14 |     int i1++;
      |           ^~
a.cc:17:11: error: expected initializer before '++' token
   17 |     int i1++;
      |           ^~
a.cc:20:11: error: expected initializer before '++' token
   20 |     int i1++;
      |           ^~
a.cc:23:11: error: expected initializer before '++' token
   23 |     int i1++;
      |           ^~
a.cc:26:13: error: 'Yes' was not declared in this scope
   26 |     cout << Yes << endl;
      |             ^~~
a.cc:29:13: error: 'No' was not declared in this scope
   29 |     cout << No << endl;
      |             ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<map>
using namespace std;

char s[4];
int a,b;

int main() {
	cin >> s[0];
	for (int i = 1; i < 4; i++) {
		cin >> s[i];
		if (s[0] == s[i])a++;
		else b++;
	}
	if (a == 1 && b == 2)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: expected '}' at end of input
   23 |         return 0;
      |                  ^
a.cc:13:12: note: to match this '{'
   13 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: expected primary-expression before '||' token
   27 |     if (S[0] == S[1]) || S[1] == S[3]) {
      |                       ^~
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            String S = scanner.next();
            Map<String, List<String>> collect = Stream.of(S.split(""))
                    .collect(Collectors.groupingBy(Function.identity()));
            if (collect.keySet().size() != 2) {
                System.out.println("false");
            } else if (collect.values().stream().filter(l -> l != 2).findAny().isPresent()) {
                System.out.println("false");
            } else {
                System.out.println("true");
            }
        }
    }

}


Compiler output:
Main.java:17: error: bad operand types for binary operator '!='
            } else if (collect.values().stream().filter(l -> l != 2).findAny().isPresent()) {
                                                               ^
  first type:  List<String>
  second type: int
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int I;
  What should I do;
  I don't know how to do here;
    I can't do anything on the Internet;
    Sorry,I'm so silly;
    I think I should study hard;
  Goodbye!
  return 0;
}

Compiler output:
a.cc:7:8: warning: missing terminating ' character
    7 |   I don't know how to do here;
      |        ^
a.cc:7:8: error: missing terminating ' character
    7 |   I don't know how to do here;
      |        ^~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:10: warning: missing terminating ' character
    8 |     I can't do anything on the Internet;
      |          ^
a.cc:8:10: error: missing terminating ' character
    8 |     I can't do anything on the Internet;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:12: warning: missing terminating ' character
    9 |     Sorry,I'm so silly;
      |            ^
a.cc:9:12: error: missing terminating ' character
    9 |     Sorry,I'm so silly;
      |            ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'What' was not declared in this scope
    6 |   What should I do;
      |   ^~~~
a.cc:7:4: error: expected ';' before 'don'
    7 |   I don't know how to do here;
      |    ^~~~
      |    ;
a.cc:11:3: error: 'Goodbye' was not declared in this scope
   11 |   Goodbye!
      |   ^~~~~~~
Language: C++

#include<stdio.h>

int main(){
	int js=0;
	char a[4];
	gets(a);
	for (int i=0;i<4;i++){
		for(int j=i+1;j < 4);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:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(a);
      |         ^~~~
      |         getw
a.cc:8:36: error: expected ';' before ')' token
    8 |                 for(int j=i+1;j < 4);j++){
      |                                    ^
      |                                    ;
a.cc:8:38: error: 'j' was not declared in this scope
    8 |                 for(int j=i+1;j < 4);j++){
      |                                      ^