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

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

int main(){
  string ANS = "Yes"
  string S;
  cin >> S;
  int count;
  for(int i=0; i<4;i++){
    for(int j=0; j<4;j++){
      if(S.at(i) == S.at(j)){
        count++;
      }
    }
    if(count != 2){
    ANS = "No";
      break;
    }
  }
  
  
  cout << ANS << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected ',' or ';' before 'string'
    6 |   string S;
      |   ^~~~~~
a.cc:7:10: error: 'S' was not declared in this scope
    7 |   cin >> S;
      |          ^
Language: C++

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

int main(){
  String S;
  cin >> S;
  int count;
  for(int i=0; i<4;i++){
    for(int j=0; j<4;j++){
      if(S.at(i) == S.at(j)){
        count++;
      }
    }
  }
  
  if(count == 2){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  
}


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

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

int main(){
  String S;
  cin >> S;
  int count;
  for(int i=0; i<4;i++){
    for(int j=0; j<4;j++){
      if(S.at(i) == S.at(j)){
        count++;
      }
    }
  }
  
  if(count == 2){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		int first = 0;
		int count = 1;

		for (int i = 1; i < 4; i++) {

			if (s.substring(0, 1).equals(s.substring(i, i + 1))) {
				count++;

				if (count > 2) {
					System.out.print("No");
					System.exit(0);
				} else {
					first = i;
				}
			}
		}
		if (count == 2) {
			if (first == 1) {
				if (s.substring(2, 3).equals(s.substring(3, 4))) {
					if (!(s.substring(0, 1).equals(s.substring(2, 3)))) {
						System.out.print("Yes");
						System.exit(0);
					}
				} else {
					System.out.print("No");
					System.exit(0);
				}
			}
			if (first == 2) {
				if (s.substring(3, 4).equals(s.substring(1, 2))) {
					if (!(s.substring(0, 1).equals(s.substring(1, 2)))) {
						System.out.print("Yes");
						System.exit(0);
					}
				} else {
					System.out.print("No");
					System.exit(0);
				}

			}
			if (first == 3) {
				if (s.substring(2, 3).equals(s.substring(1, 2))) {
					if (!(s.substring(0, 1).equals(s.substring(2, 3)))) {
						System.out.print("Yes");
						System.exit(0);
					}
				} else {
					System.out.print("No");
					System.exit(0);
				}
			}
		} else {
			System.out.print("No");
			System.exit(0);
		}

	}

}


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

int main(int argc, char *argv[])
{
  if((argv[1][0] == argv[1][1] && argv[1][2] == argv[1][3]) ||
     (argv[1][0] == argv[1][2] && argv[1][1] == argv[1][3]) ||
     (argv[1][0] == argv[1][3] && argv[1][1] == argv[1][2]))
  {
    std::cout << "Yes" ;
  }
  else
  {
    std::cout << "No" ;
  }
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:7:10: error: 'cout' is not a member of 'std'
    7 |     std::cout << "Yes" ;
      |          ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(int argc, char *argv[])
a.cc:11:10: error: 'cout' is not a member of 'std'
   11 |     std::cout << "No" ;
      |          ^~~~
a.cc:11:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#using namespace std;
 
int main(int argc, char *argv[])
{
  if((argv[1][0] == argv[1][1] && argv[1][2] == argv[1][3]) ||
     (argv[1][0] == argv[1][2] && argv[1][1] == argv[1][3]) ||
     (argv[1][0] == argv[1][3] && argv[1][1] == argv[1][2]))
  {
    cout << "Yes" ;
  }
  else
  {
    cout << "No" ;
  }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #using
    1 | #using namespace std;
      |  ^~~~~
a.cc: In function 'int main(int, char**)':
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << "Yes" ;
      |     ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "No" ;
      |     ^~~~
Language: C++

#include <iostream.h>
#using namespace std;
 
int main(int argc, char *argv[])
{
  if((argv[1][0] == argv[1][1] && argv[1][2] == argv[1][3]) ||
     (argv[1][0] == argv[1][2] && argv[1][1] == argv[1][3]) ||
     (argv[1][0] == argv[1][3] && argv[1][1] == argv[1][2]))
  {
    cout << "Yes" ;
  }
  else
  {
    cout << "No" ;
  }
}

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

#include <stdio>
#using namespace std;

int main(int argc, char *argv[])
{
  if((argv[1][0] == argv[1][1] && argv[1][2] == argv[1][3]) ||
     (argv[1][0] == argv[1][2] && argv[1][1] == argv[1][3]) ||
     (argv[1][0] == argv[1][3] && argv[1][1] == argv[1][2]))
  {
    cout << "Yes" ;
  }
  else
  {
    cout << "No" ;
  }
}

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

#include <iostream>
#include <vector>

using namespace std;

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

    vector<char> characters(s.begin(), s.end());
    char first { *characters.begin() };

    auto firstCharacterCount { count(characters.begin(), characters.end(), first) };

    sort(characters.begin(), characters.end());
    characters.erase(unique(characters.begin(), characters.end()), characters.end());

    auto numOfUniqueCharacters {static_cast<int>(characters.size()) };

    auto text = (firstCharacterCount == 2 && numOfUniqueCharacters == 2) ? "Yes" : "No";

    cout << text << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'count' was not declared in this scope
   13 |     auto firstCharacterCount { count(characters.begin(), characters.end(), first) };
      |                                ^~~~~
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(characters.begin(), characters.end());
      |     ^~~~
      |     short
a.cc:16:22: error: 'unique' was not declared in this scope
   16 |     characters.erase(unique(characters.begin(), characters.end()), characters.end());
      |                      ^~~~~~
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
int main(){
	string s;char temp1,temp2;bool res=false;
	cin >> s;
  int i,count1=0,count2=0;
  char temp1=s[0];
  for (i=0;i<s.length();i++){
		if (s[i] == temp1){    
			count1++;
        }
    	else if (s[i] != temp1) {
          	temp2 = s[i];
          	count2++;
        }
  }
	if (count1 == 0 && count 2==0) res=true;
	if (res==true) cout << "YES";
  	else cout << "NO";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: redeclaration of 'char temp1'
    8 |   char temp1=s[0];
      |        ^~~~~
a.cc:5:23: note: 'char temp1' previously declared here
    5 |         string s;char temp1,temp2;bool res=false;
      |                       ^~~~~
a.cc:18:28: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   18 |         if (count1 == 0 && count 2==0) res=true;
      |                            ^~~~~
a.cc:18:33: error: expected ')' before numeric constant
   18 |         if (count1 == 0 && count 2==0) res=true;
      |            ~                    ^~
      |                                 )
Language: C++

#include<bits/stdc++.h>

using namespace std;
int main(){
	string s;char temp1,temp2,bool res=false;
	cin >> s;
  int i,count1=0,count2=0;
  char temp1=s[0];
  for (i=0;i<s.length();i++){
		if (s[i] == temp1){    
			count1++;
        }
    	else if (s[i] != temp1) {
          	temp2 = s[i];
          	count2++;
        }
  }
	if (count1 == 0 && count 2==0) res=true;
	if (res==true) cout << "YES";
  	else cout << "NO";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:35: error: expected unqualified-id before 'bool'
    5 |         string s;char temp1,temp2,bool res=false;
      |                                   ^~~~
a.cc:8:8: error: redeclaration of 'char temp1'
    8 |   char temp1=s[0];
      |        ^~~~~
a.cc:5:23: note: 'char temp1' previously declared here
    5 |         string s;char temp1,temp2,bool res=false;
      |                       ^~~~~
a.cc:18:28: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   18 |         if (count1 == 0 && count 2==0) res=true;
      |                            ^~~~~
a.cc:18:33: error: expected ')' before numeric constant
   18 |         if (count1 == 0 && count 2==0) res=true;
      |            ~                    ^~
      |                                 )
a.cc:18:40: error: 'res' was not declared in this scope
   18 |         if (count1 == 0 && count 2==0) res=true;
      |                                        ^~~
a.cc:19:13: error: 'res' was not declared in this scope
   19 |         if (res==true) cout << "YES";
      |             ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  string str;
  vector<int> s(26, 0);
  
  cin >> str;
  for(int i = 0; i < str.size(); i++)
    s[str[i] - 'A']++;
  
  for(int i = 0; i < 26; i++){
    if(s[i] % 2 == 1){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> s(26, 0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> s(26, 0);
      |          ^~~
a.cc:10:5: error: 's' was not declared in this scope
   10 |     s[str[i] - 'A']++;
      |     ^
a.cc:13:8: error: 's' was not declared in this scope
   13 |     if(s[i] % 2 == 1){
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=100005,mod=1e9+7;
#define inf 0x7fffffff
vector<int>G[N];
int vis[N][3];
int dis[N][3];
int S,T;
struct node
{
    int id,dis;
};
queue<node>q;
void dijstra()
{
 
    for(int i=1;i<=N-5;i++)
        for(int j=0;j<3;j++)
            dis[i][j]=inf,vis[i][j]=0;
    q.push({S,0});
    dis[S][0]=0;
  	vis[u][0]=1;
    while(!q.empty())
    {
        int u=q.front().id;
        int d=q.front().dis;
        q.pop();
        if(vis[u][d])continue;
        for(auto v:G[u])
        {
            int len=(d+1)%3;
          if(vis[v][len]==0){
            if(dis[v][len]>dis[u][d]+1)
            {
                dis[v][len]=dis[u][d]+1;
                q.push({v,len});
              	vis[v][len]=1;
            }
          }
        }
    }
}
int main()
{
    int n,m,u,v;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&u,&v);
        G[u].push_back(v);
    }
    scanf("%d%d",&S,&T);
    dijstra();
    if(dis[T][0]==inf)
        puts("-1");
    else
        printf("%d\n",dis[T][0]/3);
    return 0;
}

Compiler output:
a.cc: In function 'void dijstra()':
a.cc:22:13: error: 'u' was not declared in this scope
   22 |         vis[u][0]=1;
      |             ^
Language: Java

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

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

import java.util.*;

public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String string = scan.next();
      char[] c = new char[4];
      for(int i=0;i<4;i++){
        c[i] = string.charAt(i);
      }
      if(c[0]==c[3] && c[1]==c[2] && c[0]!=h[1]){
        System.out.println("Yes");
      }else if(c[0]==c[1] && c[2]==c[3] && c[0]!=c[2]){
        System.out.println("Yes");
      }else if(c[0]==c[2] && c[1]==c[3] && c[0]!=c[1]){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
      
	}
}


Compiler output:
Main.java:11: error: cannot find symbol
      if(c[0]==c[3] && c[1]==c[2] && c[0]!=h[1]){
                                           ^
  symbol:   variable h
  location: class Main
1 error
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:128: error: expected ';' before ')' token
   26 |         cout << ((s[0] == s[1] && s[2] == s[3]) || (s[0] == s[2] && s[1] == s[3]) || (s[0] == s[3] && s[1] == s[2])?"Yes":"No")) << endl;
      |                                                                                                                                ^
      |                                                                                                                                ;
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

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

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

#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;

vector<int> read_vec(int n){
    vector<int> ret(n);
    for (int i = 0; i < n; i++){
        cin >> ret[i];
    }
    return ret;
}

int main() {
    int a = 0, b = 0;
    string s;
    cin >> s;
    for (int i = 0; i < 4; i++){
        if (s[i] == 'A'){
            a++;
        }
        if (s[i] == 'S'){
            b++;
        }
    }
    if (a != 0 && b != 0 || a == 0 && b ==){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:43: error: expected primary-expression before ')' token
   25 |     if (a != 0 && b != 0 || a == 0 && b ==){
      |                                           ^
Language: C++

#include<bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main()
{
  string s;
  cin>>s;
  map<char,int>m;
  FOR(i,4)
  {m[s[i]]++;}
  	if(m.size==2)
      cout<<"Yes"<<"\n";
  else 
    cout<<"No"<<"\n";
  return 0;
}

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

#include<bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<n;i++);
using namespace std;
int main()
{
  string s;
  cin>>s;
  map<char,int>m;
  FOR(i,4)
  {m[s[i]]++;}
  	if(m.size==2)
      cout<<"Yes"<<"\n";
  else 
    cout<<"No"<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   {m[s[i]]++;}
      |        ^
a.cc:11:14: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |         if(m.size==2)
      |            ~~^~~~
      |                  ()
Language: Java

import java.util.*;

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

    String[] strArray = sc.next().split("");

    Arrays.sort(strArray,new Comparator<String>() {
      @Override
      public int compare(String obj0, String obj1) {
        return obj0.compareTo(obj1);
      }
    });

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

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

#include<cstdio>
using namespace std;
int c[4];
int main()
{
	scanf("%s",&c);
	for(i=0;i<=3;i++)
	    for(j=0;j<=3;j++)
	    {
	    	if(i==j)continue;
	    	if(c[i]==c[j]){
	    		printf("No");
	    		return 0;
			}
		}
    printf("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         for(i=0;i<=3;i++)
      |             ^
a.cc:8:17: error: 'j' was not declared in this scope
    8 |             for(j=0;j<=3;j++)
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int cnt[26] = {0};
	string S;
	cin >> S;
	int ans = 0;
	for (i = 0; i < 4; i++) {
	    cnt[S[i] - 'A']++;
	    if (cnt[i] == 2) ans++;
	}
	if (ans == 2) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
   10 |         for (i = 0; i < 4; i++) {
      |              ^
Language: C++

#include <iostream>

int main()
{
	int cnt[26] = {0};
	string S;
	cin >> S;
	int ans = 0;
	for (i = 0; i < 4; i++) {
	    cnt[S[i] - 'A']++;
	    if (cnt[i] == 2) ans++;
	}
	if (ans == 2) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string S;
      |         ^~~~~~
a.cc:6:9: 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:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> S;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:16: error: 'S' was not declared in this scope
    7 |         cin >> S;
      |                ^
a.cc:9:14: error: 'i' was not declared in this scope
    9 |         for (i = 0; i < 4; i++) {
      |              ^
a.cc:14:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |                 cout << "Yes" << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |                 cout << "Yes" << endl;
      |                                  ^~~~
      |                                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |                 cout << "No" << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |                 cout << "No" << endl;
      |                                 ^~~~
      |                                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

s = input()
n = 4
i = 0
d = {}
while(i<n):
    if s[i] in d.keys():
        d[s[i]] +=1
    else:
        d.setdefault(s[i], 1)
    i += 1
print("Yes" if len(d)==2 and max(d.values())==2 else "No")


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
a.cc:5:1: error: expected unqualified-id before 'while'
    5 | while(i<n):
      | ^~~~~
Language: C++

#include <vector>
#include <iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++)cin>>v(i);
  sort(v.begin(),v.end());
  cout<<v[v.size()/2]-v[v.size()/2-1]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: no match for call to '(std::vector<int>) (int&)'
    8 |   for(int i=0;i<n;i++)cin>>v(i);
      |                            ~^~~
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
Language: C++

#include <stdio.h>

int main()
{
	char s[5],a[91];
	int i,m,p = 0;
	gets(s);
	for(i = 0;i < 4;i++){
		m = s[i];
		a[s[i]]++;
	}
	for(i = 65;i < 91;i++){
		if(a[i] != 0){
			p++;
		}
	}
	if(!p)
		printf("No");
	else
		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(s);
      |         ^~~~
      |         getw
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:1: error: 'string' was not declared in this scope
    2 | string s; cin >>s;
      | ^~~~~~
a.cc:2:11: error: 'cin' was not declared in this scope
    2 | string s; cin >>s;
      |           ^~~
a.cc:2:17: error: 's' was not declared in this scope
    2 | string s; cin >>s;
      |                 ^
a.cc:3:9: error: expected ';' before 'a'
    3 |   string a,b,c,d;
      |         ^~
      |         ;
a.cc:4:3: error: 'a' was not declared in this scope
    4 |   a=s.at(0);
      |   ^
a.cc:5:5: error: 'b' was not declared in this scope
    5 |     b=s.at(1);
      |     ^
a.cc:6:5: error: 'c' was not declared in this scope
    6 |     c=s.at(2);
      |     ^
a.cc:7:5: error: 'd' was not declared in this scope
    7 |     d=s.at(3);
      |     ^
a.cc:9:20: error: 'cout' was not declared in this scope
    9 |     if(a==b&&c==d){cout<< "Yes"<<endl;}
      |                    ^~~~
a.cc:9:34: error: 'endl' was not declared in this scope
    9 |     if(a==b&&c==d){cout<< "Yes"<<endl;}
      |                                  ^~~~
a.cc:10:18: error: 'cout' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |                  ^~~~
a.cc:10:31: error: 'endl' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |                               ^~~~
a.cc:11:21: error: 'cout' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |                     ^~~~
a.cc:11:34: error: 'endl' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |                                  ^~~~
a.cc:12:8: error: 'cout' was not declared in this scope
   12 |   else{cout<<"No"<<endl;
      |        ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |   else{cout<<"No"<<endl;
      |                    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:1: error: 'string' was not declared in this scope
    2 | string s; cin >>s;
      | ^~~~~~
a.cc:2:11: error: 'cin' was not declared in this scope
    2 | string s; cin >>s;
      |           ^~~
a.cc:2:17: error: 's' was not declared in this scope
    2 | string s; cin >>s;
      |                 ^
a.cc:3:9: error: expected ';' before 'a'
    3 |   string a,b,c,d;
      |         ^~
      |         ;
a.cc:4:3: error: 'a' was not declared in this scope
    4 |   a=s.at(0)
      |   ^
a.cc:10:9: error: 'c' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |         ^
a.cc:10:12: error: 'b' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |            ^
a.cc:10:15: error: 'd' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |               ^
a.cc:10:18: error: 'cout' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |                  ^~~~
a.cc:10:31: error: 'endl' was not declared in this scope
   10 |   if(a==c&&b==d){cout<<"Yes"<<endl;}
      |                               ^~~~
a.cc:11:12: error: 'd' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |            ^
a.cc:11:15: error: 'b' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |               ^
a.cc:11:18: error: 'c' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |                  ^
a.cc:11:21: error: 'cout' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |                     ^~~~
a.cc:11:34: error: 'endl' was not declared in this scope
   11 |      if(a==d&&b==c){cout<<"Yes"<<endl;}
      |                                  ^~~~
a.cc:12:8: error: 'cout' was not declared in this scope
   12 |   else{cout<<"No"<<endl;
      |        ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |   else{cout<<"No"<<endl;
      |                    ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |   a=str.at(0)
      |     ^~~
      |     std
Language: C++

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

int main(){
  map<char, int>m;
  string s;
  cin >> s;
  for(int i=0; i<4; i++)m[s[i]]++;
  if(m.size()=2 && m[s[0]]==2)cout << "Yes";
  else cout << "No";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: lvalue required as left operand of assignment
   11 |   if(m.size()=2 && m[s[0]]==2)cout << "Yes";
      |      ~~~~~~^~
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>

using namespace std;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define PRINT(str) printf(#str "\n")
#define yOUT PRINT(Yes)
#define nOUT PRINT(No)
#define YOUT PRINT(YES)
#define NOUT PRINT(NO)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

int main(){
    string s;
    cin >> a;
    sort(all(s));
    if(s[0] == s[1] && s[2] == s[3]) YOUT;
    else NOUT;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: 'a' was not declared in this scope
   29 |     cin >> a;
      |            ^
Language: C

#include<stdio.h>
int main(void){
  char str[5];
  int i;
  for(i=1;i<5;i++)
    scanf("%s",&str);
  if(str[0]==str[1]||str[0]==str[2]||str[0]==str[3]||str[2]==str[1]||str[1]==str[3]||str[2]==str[3]){
    printf("Yes");
  else if(str[0]==str[1]&&str[2]==str[3])
       printf("Yes");
  else if(str[0]==str[2]&&str[1]==str[3])
       printf("Yes");
  else  if(str[0]==str[3]&&str[1]==str[2])
       printf("Yes");
  
  
    
   else
    printf("N0");
    return 0;
  }
    
    
    
    
    
    
 


Compiler output:
main.c: In function 'main':
main.c:9:3: error: expected '}' before 'else'
    9 |   else if(str[0]==str[1]&&str[2]==str[3])
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int sum=0;
  string str;
  cin >> str;
  
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j+i < 4;j++) {
      if(str.at(i) == str.at(i+j) {
        sum += 1;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: expected ')' before '{' token
   11 |       if(str.at(i) == str.at(i+j) {
      |         ~                        ^~
      |                                  )
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
Language: C++

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

int main(){
  string s;cin >> s;
  sort(s.begin(),s.end());
  if(s[0]==s[1]&&s[2]==s[3]&&s[1]!=s[2]) puts("Yes");
  else puts("No");
  return 0;
}

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

#include<stdio.h>
int main(void){
  char str[5];
  int i;
  for(i=1;i<5;i++)
    scanf("%c",&str[i]);
  if(str[0]==str[1]||str[0]==str[2]||str[0]||str[3]||str[2]==str[1]||str[1]==str[3]||str[2]==str[3])
    printf("Yes");
  if(str[0]==str[1]&&str[2]==str[3])
       printf("Yes");
   if(str[0]==str[2]&&str[1]==str[3])
       printf("Yes");
    if(str[0]==str[3]&&str[1]==str[2])
       printf("Yes");
  
  
    
   if else
    printf("N0");
 
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: expected '(' before 'else'
   18 |    if else
      |       ^~~~
      |       (
Language: C

#include<stdio.h>
int main(void){
  char str[5];
  int i;
  for(i=1;i<5;i++)
    scanf("%d",&str[i]);
  if(str[0]==str[1]||str[0]==str[2]||str[0]||str[3]||str[2]==str[1]||str[1]==str[3]||str[2]==str[3]){
    printf("Yes");
  else
    printf("N0");
}
}

Compiler output:
main.c: In function 'main':
main.c:9:3: error: expected '}' before 'else'
    9 |   else
      |   ^~~~
main.c: At top level:
main.c:12:1: error: expected identifier or '(' before '}' token
   12 | }
      | ^
Language: C

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

void main(void){
	char buf[5]={\0};
  	char ch;
	int cnt=0;
	char *pt=NULL;
	int ans=0;

	scanf("%s",buf);

    cnt=0;
	while(1){
	  if(buf[cnt+1]=='\0'){
		  break;
	  }
	  if(buf[cnt]!='\n'){
		ch=buf[cnt];
		buf[cnt]='\n';
		pt=strchr(buf,ch);
		if(pt==NULL){
			ans=-1;
			break;
		}else{
			*pt='\n';
			pt=NULL;
		}
	  }

	cnt++;
  }
  if(ans==0){
	  printf("Yes\n");
  }else{
	  printf("No\n");
  }

}

Compiler output:
main.c: In function 'main':
main.c:7:22: error: stray '\' in program
    7 |         char buf[5]={\0};
      |                      ^
Language: C

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

void test(void){
	char buf[5];
  	char ch;
	int cnt=0;
	char *pt=NULL;
	int ans=0;

	scanf("%s",buf);

    cnt=0;
	while(1){
	  if(buf[cnt+1]=='\0'){
		  break;
	  }
	  if(buf[cnt]!='\n'){
		ch=buf[cnt];
		buf[cnt]='\n';
		pt=strchr(buf,ch);
		if(pt==NULL){
			ans=-1;
			break;
		}else{
			*pt='\n';
			pt=NULL;
		}
	  }

	cnt++;
  }
  if(ans==0){
	  printf("YES\n");
  }else{
	  printf("NO\n");
  }

}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char s[4];
  int i,j,check[4],dem=0,f1=1,f2=1;
  scanf("%s", &s);
  check[0]=0;
  check[1]=0;
  check[2]=0;
  check[3]=0;w
  for (i=0; i<3; i++)
    {
      if (check[i]==0) 
        {
          dem++;
          check[i]=1;
        }
      else for (j=i+1; j<4; j++)
        {
          if (s[j]==s[i] && check[j]==0) check[j]=1;
        }
      if (dem!=2) printf("No");
      else
        {
          for (i=1; i<4; i++)
            if (s[i]==s[0]) f1++;
          if (f1==2) printf("Yes");
           else printf("No");
        }
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:14: error: 'w' undeclared (first use in this function)
   11 |   check[3]=0;w
      |              ^
main.c:11:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:15: error: expected ';' before 'for'
   11 |   check[3]=0;w
      |               ^
      |               ;
   12 |   for (i=0; i<3; i++)
      |   ~~~
Language: C++

#include <stdio.h>
int main(void){
	char s[4];
      char tmp;
    for(int i=0;i<4;i++){
    	scanf("%s",s[i]);
    }
    for (int i=0; i<4; i++) {
    for (int j=1; j<4; j++) {
      if (s[j-1] < s[j]) {
        tmp =  s[j-1];
        s[j-1] = s[j];
        s[j] = tmp;
      }
    }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  

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

#include <stdio.h>
int main(void){
	char s[4];
      char tmp;
    for(int i=0;i<4;i++){
    	scanf("%c",&s[i]);
    }
    for (int i=0; i<4; i++) {
    for (int j=1; j<4; j++) {
      if (s[j-1] < s[j]) {
        tmp =  s[j-1];
        s[j-1] = s[j];
        s[j] = tmp;
      }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  }

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

#include <stdio.h>
int main(void){
	char s[4];
      char tmp;
    for(int i=0;i<4;i++){
    	scanf("%c",s[i]);
    }
    for (i=0; i<4; i++) {
    for (j=1; j<4; j++) {
      if (s[j-1] < s[j]) {
        tmp =  s[j-1];
        s[j-1] = s[j];
        s[j] = tmp;
      }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i=0; i<4; i++) {
      |          ^
a.cc:9:10: error: 'j' was not declared in this scope
    9 |     for (j=1; j<4; j++) {
      |          ^
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <stdio.h>
int main(void){
	char s[4];
      char tmp;
    for(int i=0;i<4;i++){
    	scanf("%c",s[i];
    }
    for (i=0; i<4; i++) {
    for (j=1; j<4; j++) {
      if (s[j-1] < s[j]) {
        tmp =  s[j-1];
        s[j-1] = s[j];
        s[j] = tmp;
      }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before ';' token
    6 |         scanf("%c",s[i];
      |              ~         ^
      |                        )
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i=0; i<4; i++) {
      |          ^
a.cc:9:10: error: 'j' was not declared in this scope
    9 |     for (j=1; j<4; j++) {
      |          ^
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <stdio.h>
int main(void){
	char s[4];
      char tmp;
    for(int i=0;i<4;i++){
    	scanf("%c",s[i];
    }
    for (i=0; i<total; ++i) {
    for (j=i+1; j<total; ++j) {
      if (s[i] > s[j]) {
        tmp =  s[i];
        s[i] = s[j];
        s[j] = tmp;
      }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before ';' token
    6 |         scanf("%c",s[i];
      |              ~         ^
      |                        )
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i=0; i<total; ++i) {
      |          ^
a.cc:8:17: error: 'total' was not declared in this scope
    8 |     for (i=0; i<total; ++i) {
      |                 ^~~~~
a.cc:9:10: error: 'j' was not declared in this scope
    9 |     for (j=i+1; j<total; ++j) {
      |          ^
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <stdio.h>
int main(void){
	char s[4];
      char s;
    for(int i=0;i<4;i++){
    	scanf("%c",s[i];
    }
    for (i=0; i<total; ++i) {
    for (j=i+1; j<total; ++j) {
      if (s[i] > s[j]) {
        tmp =  s[i];
        s[i] = s[j];
        s[j] = tmp;
      }
    }
    if(s[1]!=s[2]&&s[0]==s[1]&&s[2]==s[3]){
    	printf("yes");
    }else{
    	printf("no");
    }
      return 0;
  }
        


Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: conflicting declaration 'char s'
    4 |       char s;
      |            ^
a.cc:3:14: note: previous declaration as 'char s [4]'
    3 |         char s[4];
      |              ^
a.cc:6:24: error: expected ')' before ';' token
    6 |         scanf("%c",s[i];
      |              ~         ^
      |                        )
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i=0; i<total; ++i) {
      |          ^
a.cc:8:17: error: 'total' was not declared in this scope
    8 |     for (i=0; i<total; ++i) {
      |                 ^~~~~
a.cc:9:10: error: 'j' was not declared in this scope
    9 |     for (j=i+1; j<total; ++j) {
      |          ^
a.cc:11:9: error: 'tmp' was not declared in this scope
   11 |         tmp =  s[i];
      |         ^~~
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <stdio.h>
int main(void) {
	int n, cnt = 0;
	scanf_s("%d", &n);
	int p[20];
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &p[i]);
	}
	if (n == 3) {
		if ((p[0] > p[1] && p[2] < p[1]) || (p[0]<p[1] && p[2]>p[1])) {
			cnt++;
		}
	}
	for (int i = 2; i < n - 1; i++) {
		if ((p[i - 1] > p[i] && p[i + 1] < p[i]) || (p[i - 1]<p[i] && p[i + 1]>p[i])) {
			cnt++;
		}
	}
	printf("%d", cnt);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    4 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
int main(void){
	int n,cnt;
    scanf_s("%d",&n);
    int* p = new int[n];
  	for(int i=2;i<n-1;i++){
    	if((p[i-1]>p[i]&&p[i+1]<p[i])||(p[i-1]<p[i]&&p[i+1]>p[i])){
        	cnt++;
        }
    }
  	printf("%d",cnt);
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    4 |     scanf_s("%d",&n);
      |     ^~~~~~~
      |     scanf
Language: C++

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

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


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

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

int main(){
  string s;
  cin >> s;
  
  map<char,int> ma;
  
  for(int i = 0;i < s.size();i++){
   		ma[s[i]]++; 
  }
    
  if(ma.size() != 2){
   	cout << "No" << endl;
    return 0;
  }
 auto p = ma.begin();
 auto q = ma.begin(); q++;
  else if(p->second == 2 && q->second == 2){
    cout << "Yes" << endl;
  }
  
  else{
   cout << "No" << endl; 
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'else' without a previous 'if'
   20 |   else if(p->second == 2 && q->second == 2){
      |   ^~~~
Language: C++

def f_f(str):
    for s in str:
        if str.count(s) != 2:
            return False
        else:
            return True

S = input()
f_f(S)
if f_f(S):
    print("Yes")
else:
    print("No")


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def f_f(str):
      | ^~~
Language: C++

var s:string;
    i,k,j:integer;
    
begin
    read(s);
    
      if (s[1]=s[2]) and (s[1]<>s[3]) and (s[3]=s[4]) then write('yes');
      if (s[1]<>s[2]) and (s[1]=s[3]) and (s[2]=s[4]) then write('yes');
      if (s[1]<>s[2]) and (s[4]=s[3]) and (s[1]=s[4]) then write('yes');
      
      for i:=1 to 4 do 
         for j:= i+1 to 4 do
           if s[i]=s[j] then inc(k);
           
      if k<>1 then write('no');
end.     

Compiler output:
a.cc:7:66: warning: multi-character character constant [-Wmultichar]
    7 |       if (s[1]=s[2]) and (s[1]<>s[3]) and (s[3]=s[4]) then write('yes');
      |                                                                  ^~~~~
a.cc:8:66: warning: multi-character character constant [-Wmultichar]
    8 |       if (s[1]<>s[2]) and (s[1]=s[3]) and (s[2]=s[4]) then write('yes');
      |                                                                  ^~~~~
a.cc:9:66: warning: multi-character character constant [-Wmultichar]
    9 |       if (s[1]<>s[2]) and (s[4]=s[3]) and (s[1]=s[4]) then write('yes');
      |                                                                  ^~~~~
a.cc:15:26: warning: multi-character character constant [-Wmultichar]
   15 |       if k<>1 then write('no');
      |                          ^~~~
a.cc:1:1: error: 'var' does not name a type
    1 | var s:string;
      | ^~~
a.cc:2:5: error: 'i' does not name a type
    2 |     i,k,j:integer;
      |     ^
a.cc:4:1: error: 'begin' does not name a type
    4 | begin
      | ^~~~~
a.cc:7:7: error: expected unqualified-id before 'if'
    7 |       if (s[1]=s[2]) and (s[1]<>s[3]) and (s[3]=s[4]) then write('yes');
      |       ^~
a.cc:8:7: error: expected unqualified-id before 'if'
    8 |       if (s[1]<>s[2]) and (s[1]=s[3]) and (s[2]=s[4]) then write('yes');
      |       ^~
a.cc:9:7: error: expected unqualified-id before 'if'
    9 |       if (s[1]<>s[2]) and (s[4]=s[3]) and (s[1]=s[4]) then write('yes');
      |       ^~
a.cc:11:7: error: expected unqualified-id before 'for'
   11 |       for i:=1 to 4 do
      |       ^~~
a.cc:15:7: error: expected unqualified-id before 'if'
   15 |       if k<>1 then write('no');
      |       ^~
a.cc:16:1: error: 'end' does not name a type
   16 | end.
      | ^~~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected identifier or '(' before '[' token
    6 |         char[5] S;
      |             ^
main.c:8:21: error: 'S' undeclared (first use in this function)
    8 |         scanf("%s", S);
      |                     ^
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

void main()
{
	char count = 0;
	char[5] S;
	
	scanf("%s", S);
	
	for(char i = 0; i < 4; i++)
	{
		for(char j = i + 1; j < 4; j++)
		{
			if(S[i] == S[j]) count++;
	    }
	}
	
	if(count == 2) printf("Yes"); else printf("No");
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected identifier or '(' before '[' token
    6 |         char[5] S;
      |             ^
main.c:8:21: error: 'S' undeclared (first use in this function)
    8 |         scanf("%s", S);
      |                     ^
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<string>
#include <ctype.h>
using namespace std;
int main()
{
  string S;
  
  // 標準入力から文字列を受け取る
  cin >> S;
  
  // 文字列の長さチェック
  if(S.size() == 4)
  {
    // 大文字チェック
    for(int i = 0 ; i < S.size() ; i++)
    {
      if(!isupper((unsigned char(S[i]))))
      {
      	return 0;
      }
    }
    
    // 文字列チェック
    int a = (int)S.find(S[0], 1);
    if(a == 1)
    {
      int b = (int)S.find(S[2], 3);
      int c = (int)S.find(S[0], 2);
      if((b == 3) && (c == -1))
      {
        cout << "Yes" << endl;
      }
      else
      {
        cout << "No" << endl;
      }
    }
    else if(a == 2)
    {
      int b = (int)S.find(S[1], 3);
      int c = (int)S.find(S[0], 3);
      if((b == 3) && (c == -1))
      {
        cout << "Yes" << endl;
      }
      else
      {
        cout << "No" << endl;
      }
    }
    else if(a == 3)
    {
      int b = (int)S.find(S[1], 2);
      if(b == 2)
      {
        cout << "Yes" << endl;
      }
      else
      {
        cout << "No" << endl;
      }
    }
    else
    {
      cout << "No" << endl;
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected primary-expression before 'unsigned'
   18 |       if(!isupper((unsigned char(S[i]))))
      |                    ^~~~~~~~
a.cc:18:20: error: expected ')' before 'unsigned'
   18 |       if(!isupper((unsigned char(S[i]))))
      |                   ~^~~~~~~~
      |                    )
a.cc:21:8: error: expected ')' before '}' token
   21 |       }
      |        ^
      |        )
   22 |     }
      |     ~   
a.cc:18:9: note: to match this '('
   18 |       if(!isupper((unsigned char(S[i]))))
      |         ^
a.cc:22:5: error: expected primary-expression before '}' token
   22 |     }
      |     ^