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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: invalid type argument of unary '*' (have 'char')
    6 |   cin >> *S[0] >> *S[1] >> *S[2] >> *S[3];
      |          ^~~~~
a.cc:6:19: error: invalid type argument of unary '*' (have 'char')
    6 |   cin >> *S[0] >> *S[1] >> *S[2] >> *S[3];
      |                   ^~~~~
a.cc:6:28: error: invalid type argument of unary '*' (have 'char')
    6 |   cin >> *S[0] >> *S[1] >> *S[2] >> *S[3];
      |                            ^~~~~
a.cc:6:37: error: invalid type argument of unary '*' (have 'char')
    6 |   cin >> *S[0] >> *S[1] >> *S[2] >> *S[3];
      |                                     ^~~~~
a.cc:7:7: error: invalid type argument of unary '*' (have 'char')
    7 |   if (*S[0] == *S[1]) {
      |       ^~~~~
a.cc:7:16: error: invalid type argument of unary '*' (have 'char')
    7 |   if (*S[0] == *S[1]) {
      |                ^~~~~
a.cc:8:9: error: invalid type argument of unary '*' (have 'char')
    8 |     if (*S[2] == *S[3])
      |         ^~~~~
a.cc:8:18: error: invalid type argument of unary '*' (have 'char')
    8 |     if (*S[2] == *S[3])
      |                  ^~~~~
a.cc:11:12: error: invalid type argument of unary '*' (have 'char')
   11 |   else if (*S[0] == *S[2]) {
      |            ^~~~~
a.cc:11:21: error: invalid type argument of unary '*' (have 'char')
   11 |   else if (*S[0] == *S[2]) {
      |                     ^~~~~
a.cc:12:9: error: invalid type argument of unary '*' (have 'char')
   12 |     if (*S[1] == *S[3])
      |         ^~~~~
a.cc:12:18: error: invalid type argument of unary '*' (have 'char')
   12 |     if (*S[1] == *S[3])
      |                  ^~~~~
a.cc:15:12: error: invalid type argument of unary '*' (have 'char')
   15 |   else if (*S[0] == *S[3]) {
      |            ^~~~~
a.cc:15:21: error: invalid type argument of unary '*' (have 'char')
   15 |   else if (*S[0] == *S[3]) {
      |                     ^~~~~
a.cc:16:9: error: invalid type argument of unary '*' (have 'char')
   16 |     if (*S[1] == *S[2])
      |         ^~~~~
a.cc:16:18: error: invalid type argument of unary '*' (have 'char')
   16 |     if (*S[1] == *S[2])
      |                  ^~~~~
a.cc:20:17: error: expected ';' before 'return'
   20 |     cout << "No"
      |                 ^
      |                 ;
   21 |     return 0;
      |     ~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:93: error: 'ednl' was not declared in this scope
    8 |         if(S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) cout << "Yes" << ednl;
      |                                                                                             ^~~~
Language: C++

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

int main(){
	vector<char> S(4);
	for(int i = 0; i < 4; i++) cin >> S.at(i);
	if(S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) cout << "Yes" << ednl;
	else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:93: error: 'ednl' was not declared in this scope
    7 |         if(S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) cout << "Yes" << ednl;
      |                                                                                             ^~~~
Language: C++

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

int main(){
	string S;
	sort(S.begin(), S.end());
	if(S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) cout << "Yes" << ednl;
	else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:93: error: 'ednl' was not declared in this scope
    7 |         if(S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) cout << "Yes" << ednl;
      |                                                                                             ^~~~
Language: C++

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng s;
      |   ^~~~~~
a.cc: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;
  
  vector<char> mao(4);
  for (int i=0; i<4; i++) {
    mao.at(i) = s.at(i)
  }
  
  sort(mao.begin(),mao.end());
  
  if (mao.at(0)==mao.at(1) && mao.at(1)!=mao.at(2) && mao.at(2)==mao.at(3)) {
    cout<< "Yes"<<endl;
  }
  else {
    cout<< "No"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before '}' token
   10 |     mao.at(i) = s.at(i)
      |                        ^
      |                        ;
   11 |   }
      |   ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected primary-expression before '.' token
   10 |     mao.at(i) = string.at(i)
      |                       ^
Language: C++

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:94: error: expected ')' before ']' token
    8 |     if ((s[0] == s[1] && s[2] == s[3] || s[0] == s[2] && s[1] == s[3] || s[2] == s[1] && s[0]] == s[3])&&!(s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3]))
      |         ~                                                                                    ^
      |                                                                                              )
a.cc:9:30: error: expected ')' before ';' token
    9 |         cout << "Yes" << endl;
      |                              ^
      |                              )
a.cc:8:8: note: to match this '('
    8 |     if ((s[0] == s[1] && s[2] == s[3] || s[0] == s[2] && s[1] == s[3] || s[2] == s[1] && s[0]] == s[3])&&!(s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3]))
      |        ^
Language: C++

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:93: error: expected ')' before ']' token
    8 |     if (s[0] == s[1] && s[2] == s[3] || s[0] == s[2] && s[1] == s[3] || s[2] == s[1] && s[0]] == s[3])
      |        ~                                                                                    ^
      |                                                                                             )
a.cc:8:93: error: expected primary-expression before ']' token
Language: C++



#include <iostream>
#include <string>
void tuginodankai(int,char,char);

int main()
{
	std::string mojiretu;
	std::cin >> mojiretu;
	if (mojiretu[0] == mojiretu[1])
	{
		tuginodankai(0,mojiretu[2],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[2])
	{
		tuginodankai(1,mojiretu[1],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[3])
	{
		tuginodankai(2,mojiretu[1],mojiretu[2]);
	}else std::cout << "No" << std::endl

}


void tuginodankai(int baaiwake, char mojiiti,char mojini)
{
	switch (baaiwake) {
	case 0:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 1:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 2:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	}
	return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:45: error: expected ';' before '}' token
   22 |         }else std::cout << "No" << std::endl
      |                                             ^
      |                                             ;
   23 | 
   24 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>


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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'else' without a previous 'if'
   17 |     else if (a[0] == a[2] && a[1] == a[3] && a[0] != a[1]) printf("Yes");;
      |     ^~~~
a.cc:18:5: error: 'else' without a previous 'if'
   18 |     else if (a[0] == a[3] && a[1] == a[2] && a[0] != a[1]) printf("Yes");
      |     ^~~~
Language: C++

#include <iostream>
#include <string>

int main()
{
	std::string mojiretu;
	std::cin >> mojiretu;
	if (mojiretu[0] == mojiretu[1])
	{
		tuginodankai(0,mojiretu[2],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[2])
	{
		tuginodankai(1,mojiretu[1],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[3])
	{
		tuginodankai(2,mojiretu[1],mojiretu[2]);
	}

}


void tuginodankai(int baaiwake, char mojiiti,char mojini)
{
	switch (baaiwake) {
	case 0:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 1:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 2:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	}
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'tuginodankai' was not declared in this scope
   10 |                 tuginodankai(0,mojiretu[2],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:14:17: error: 'tuginodankai' was not declared in this scope
   14 |                 tuginodankai(1,mojiretu[1],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:18:17: error: 'tuginodankai' was not declared in this scope
   18 |                 tuginodankai(2,mojiretu[1],mojiretu[2]);
      |                 ^~~~~~~~~~~~
Language: C++


#include <iostream>
#include <string>

int main()
{
	std::string mojiretu;
	std::cin >> mojiretu;
	if (mojiretu[0] == mojiretu[1])
	{
		tuginodankai(0,mojiretu[2],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[2])
	{
		tuginodankai(1,mojiretu[1],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[3])
	{
		tuginodankai(2,mojiretu[1],mojiretu[2]);
	}

}


void tuginodankai(int baaiwake, char mojiiti,char mojini)
{
	switch (baaiwake) {
	case 0:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 1:
		if(mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 2:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'tuginodankai' was not declared in this scope
   11 |                 tuginodankai(0,mojiretu[2],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:15:17: error: 'tuginodankai' was not declared in this scope
   15 |                 tuginodankai(1,mojiretu[1],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:19:17: error: 'tuginodankai' was not declared in this scope
   19 |                 tuginodankai(2,mojiretu[1],mojiretu[2]);
      |                 ^~~~~~~~~~~~
a.cc: In function 'void tuginodankai(int, char, char)':
a.cc:50:2: error: expected '}' at end of input
   50 | }
      |  ^
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

//

#include <iostream>
#include <string>

int main()
{
	std::string mojiretu;
	std::cin >> mojiretu;
	if (mojiretu[0] == mojiretu[1])
	{
		tuginodankai(0,mojiretu[2],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[2])
	{
		tuginodankai(1,mojiretu[1],mojiretu[3]);
	}
	else if (mojiretu[0] == mojiretu[3])
	{
		tuginodankai(2,mojiretu[1],mojiretu[2]);
	}

}


void tuginodankai(int baaiwake, char mojiiti,char mojini)
{
	switch (baaiwake) {
	case 0:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 1:
		if(mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;
	case 2:
		if (mojiiti == mojini)
		{
			std::cout << "Yes" << std::endl;
		}
		else std::cout << "No" << std::endl;
		break;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'tuginodankai' was not declared in this scope
   12 |                 tuginodankai(0,mojiretu[2],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:16:17: error: 'tuginodankai' was not declared in this scope
   16 |                 tuginodankai(1,mojiretu[1],mojiretu[3]);
      |                 ^~~~~~~~~~~~
a.cc:20:17: error: 'tuginodankai' was not declared in this scope
   20 |                 tuginodankai(2,mojiretu[1],mojiretu[2]);
      |                 ^~~~~~~~~~~~
a.cc: In function 'void tuginodankai(int, char, char)':
a.cc:51:2: error: expected '}' at end of input
   51 | }
      |  ^
a.cc:27:1: note: to match this '{'
   27 | {
      | ^
Language: Java

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

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
            out.flush();
        }
    }

    void solve(InputReader in, PrintWriter out) {
        String s = in.next();
        Map<Character, Integer> map = new HashMap<>();
        char tmp = '';
        for (char c : s.toCharArray()) {
            map.merge(c, 1, Integer::sum);
            tmp = c;
        }

        if (map.size() == 2 && map.get(tmp) == 2) {
            out.println("Yes");
        } else {
            out.println("No");
        }
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

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

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

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}


Compiler output:
Main.java:15: error: empty character literal
        char tmp = '';
                   ^
1 error
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if(s[0]==s[1] && s[2]==s[3]) {
      |   ^~~~
Language: C

#include<string.h>
int main()
{
    char x[5];
    int j,i,c=0;
    fgets(x,5,stdin);
    for(i=1;i<4;i++)
    {
        if(x[0] == x[i]) j=i;
    }
    for(i=1;i<4;i++)
    {
        if(x[j]!=x[i] && x[0]!=x[i])
        c++;
    }

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


Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    6 |     fgets(x,5,stdin);
      |     ^~~~~
main.c:6:15: error: 'stdin' undeclared (first use in this function)
    6 |     fgets(x,5,stdin);
      |               ^~~~~
main.c:2:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
    1 | #include<string.h>
  +++ |+#include <stdio.h>
    2 | int main()
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
    6 |     fgets(x,5,stdin);
      |               ^~~~~
main.c:17:15: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     if(c==2 ) printf("Yes\n");
      |               ^~~~~~
main.c:17:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:15: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:10: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |     else printf("No\n");
      |          ^~~~~~
main.c:18:10: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

include <bits/stdc++.h>
using namespace std;
#define show(x) cout << #x << " : " << x << endl;

int main ()
{
 string s;
 cin >> s;
 map < char, int > mp;
 int i, cnt = 0;
 for(i = 0; i < 4; i++)
 {
   mp[s[i]]++;
   if(mp[s[i]] == 2) cnt++;
   if(cnt == 2)
   {
     cout << "YES" << endl;
     exit(0);
   }
 }
 cout << "NO" << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:2: error: 'string' was not declared in this scope
    7 |  string s;
      |  ^~~~~~
a.cc:8:2: error: 'cin' was not declared in this scope
    8 |  cin >> s;
      |  ^~~
a.cc:8:9: error: 's' was not declared in this scope
    8 |  cin >> s;
      |         ^
a.cc:9:2: error: 'map' was not declared in this scope
    9 |  map < char, int > mp;
      |  ^~~
a.cc:9:8: error: expected primary-expression before 'char'
    9 |  map < char, int > mp;
      |        ^~~~
a.cc:13:4: error: 'mp' was not declared in this scope
   13 |    mp[s[i]]++;
      |    ^~
a.cc:17:6: error: 'cout' was not declared in this scope
   17 |      cout << "YES" << endl;
      |      ^~~~
a.cc:17:23: error: 'endl' was not declared in this scope
   17 |      cout << "YES" << endl;
      |                       ^~~~
a.cc:18:6: error: 'exit' was not declared in this scope
   18 |      exit(0);
      |      ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | include <bits/stdc++.h>
a.cc:21:2: error: 'cout' was not declared in this scope
   21 |  cout << "NO" << endl;
      |  ^~~~
a.cc:21:18: error: 'endl' was not declared in this scope
   21 |  cout << "NO" << endl;
      |                  ^~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  char t = s.at(0);
  if (s.at(0) == s.at(1)){
    char u = s.at(2);
  }
  else {
    char u = s.at(1);
  }
  int tc = 0;
  int uc = 0;
  for (int i = 0; i < 4; i++){
    if (s.at(i) == u){
      uc++;
    }
    else if (s.at(i) == t) {
      tc++;
    }
  }
  if (tc == 2 && uc == 2) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'u' was not declared in this scope
   17 |     if (s.at(i) == u){
      |                    ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  char t == s.at(0);
  if (s.at(0) == s.at(1)){
    char u = s.at(2);
  }
  else {
    char u = s.at(1);
  }
  int tc = 0;
  int uc = 0;
  for (int i = 0; i < 4; i++){
    if (s.at(i) == u){
      uc++
    }
    else if (s.at(i) == t) {
      tc++
    }
  }
  if (tc == 2 && uc == 2) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected initializer before '==' token
    7 |   char t == s.at(0);
      |          ^~
a.cc:17:20: error: 'u' was not declared in this scope
   17 |     if (s.at(i) == u){
      |                    ^
a.cc:18:11: error: expected ';' before '}' token
   18 |       uc++
      |           ^
      |           ;
   19 |     }
      |     ~      
a.cc:20:25: error: 't' was not declared in this scope
   20 |     else if (s.at(i) == t) {
      |                         ^
a.cc:21:11: error: expected ';' before '}' token
   21 |       tc++
      |           ^
      |           ;
   22 |     }
      |     ~
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)) || (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:7:95: error: expected ')' before '{' token
    7 |   if ((s.at(0) == s.at(1) && s.at(2) == s.at(3)) || (s.at(0) == s.at(3) && s.at(1) == s.at(2)){
      |      ~                                                                                        ^
      |                                                                                               )
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

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

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

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    string s; cin >> s;
    sort(s.bigin(),s.end());
    if(s.at(0)==s.at(1) && s.at(2)==s.at(3) && s.at(0)!=s.at(2)) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
    6 |     sort(s.bigin(),s.end());
      |            ^~~~~
      |            begin
Language: C++

#include <iostream>
#include <algorythm>
using namespace std;
int main(){
    string s; cin >> s;
    sort(s.bigin(),s.end());
    if(s.at(0)==s.at(1) && s.at(2)==s.at(3) && s.at(0)!=s.at(2)) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;   
}

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

#include <iostream>
using namespace std;
int main(){
    string s; cin >> s;
    sort(s.bigin(),s.end());
    if(s.at(0)==s.at(1) && s.at(2)==s.at(3) && s.at(0)!=s.at(2)) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
    5 |     sort(s.bigin(),s.end());
      |            ^~~~~
      |            begin
a.cc:5:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    5 |     sort(s.bigin(),s.end());
      |     ^~~~
      |     short
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
 
 
        // Scannerクラスのインスタンスの生成
        Scanner sc = new Scanner(System.in);
        
        String[] ss = sc.next().split("");
      
        if(ss[0].equals(ss[1]) && ss[2].equals(ss[3]) && !(ss[0].equals(ss[2]))) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(ss[0].equals(ss[1])) {
        	System.out.println("Yes");
 
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(ss[0].equals(ss[1])) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
	}
 
}

Compiler output:
Main.java:13: error: ')' expected
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(ss[0].equals(ss[1])) {
                                                                                       ^
Main.java:16: error: ')' expected
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(ss[0].equals(ss[1])) {
                                                                                       ^
2 errors
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
 
 
        // Scannerクラスのインスタンスの生成
        Scanner sc = new Scanner(System.in);
        
        String[] ss = sc.next().split("");
      
        if(ss[0].equals(ss[1]) && ss[2].equals(ss[3]) && !(ss[0].equals(s[2]))) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(ss[0].equals(s[1])) {
        	System.out.println("Yes");
 
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(ss[0].equals(s[1])) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
	}
 
}

Compiler output:
Main.java:13: error: ')' expected
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(ss[0].equals(s[1])) {
                                                                                      ^
Main.java:16: error: ')' expected
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(ss[0].equals(s[1])) {
                                                                                      ^
2 errors
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
 
 
        // Scannerクラスのインスタンスの生成
        Scanner sc = new Scanner(System.in);
        
        String[] ss = sc.next().split("");
      
        if(ss[0].equals(ss[1]) && ss[2].equals(ss[3]) && !(s[0].equals(s[2]))) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(s[0].equals(s[1])) {
        	System.out.println("Yes");
 
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(s[0].equals(s[1])) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
	}
 
}

Compiler output:
Main.java:13: error: ')' expected
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3]) && !(s[0].equals(s[1])) {
                                                                                     ^
Main.java:16: error: ')' expected
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2]) && !(s[0].equals(s[1])) {
                                                                                     ^
2 errors
Language: Java

import java.util.Scanner;
public class Main {
}	public static void main(String[] args) throws Exception {
 
 
        // Scannerクラスのインスタンスの生成
        Scanner sc = new Scanner(System.in);
        
        String[] ss = sc.next().split("");
      
        if(ss[0].equals(ss[1]) && ss[2].equals(ss[3])) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3])) {
        	System.out.println("Yes");
 
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2])) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
	}
 
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
}	public static void main(String[] args) throws Exception {
 	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:23: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
​
​
        // Scannerクラスのインスタンスの生成
        Scanner sc = new Scanner(System.in);
        char s = sc.next();
        char[] ss = new char[3];
        ss = s.split("");
​
        if(ss[0].equals(ss[1]) && ss[2].equals(ss[3])) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[2]) && ss[1].equals(ss[3])) {
        	System.out.println("Yes");
        } else if (ss[0].equals(ss[3]) && ss[1].equals(ss[2])) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
	}
​
}
折りたたむ






Compiler output:
Main.java:4: error: illegal character: '\u200b'
?
^
Main.java:5: error: illegal character: '\u200b'
?
^
Main.java:11: error: illegal character: '\u200b'
?
^
Main.java:22: error: illegal character: '\u200b'
?
^
Main.java:24: error: reached end of file while parsing
?????
     ^
5 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'scanf' was not declared in this scope
    5 |   scanf( "%s", str );
      |   ^~~~~
a.cc:10:5: error: 'printf' was not declared in this scope
   10 |     printf( "Yes\n" );
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
a.cc:12:5: error: 'printf' was not declared in this scope
   12 |     printf( "No\n" );
      |     ^~~~~~
a.cc:12:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include<stdio.h>
int main () {
	char S[5]
	char s[5];
	scanf("%s", &S[0]);
	int cnt = 1;
	s[0] = S[0];
	for(int i = 1; i < 4; ++i){
		for(int k = 0; k < cnt; k++){
			if(s[k] != S[i]) {
				cnt++;
				continue;
			}
		}
	}
	if(cnt == 2) puts("Yes");
	else puts("No");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:18: error: expected ';' before 'char'
    3 |         char S[5]
      |                  ^
      |                  ;
    4 |         char s[5];
      |         ~~~~      
main.c:5:22: error: 'S' undeclared (first use in this function)
    5 |         scanf("%s", &S[0]);
      |                      ^
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main () {
	char S[5], s[5];
	scanf("%s", S);
	int cnt = 1;
	s[0] = S[0]
	for(int i = 1; i < 4; ++i){
		for(int k = 0; k < cont; k++){
			if(s[k] != S[i]) {
				cnt++;
				continue;
			}
		}
	}
	if(cnt == 2) puts("Yes");
	else puts("No");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:20: error: expected ';' before 'for'
    6 |         s[0] = S[0]
      |                    ^
      |                    ;
    7 |         for(int i = 1; i < 4; ++i){
      |         ~~~         
main.c:16:9: error: 'else' without a previous 'if'
   16 |         else puts("No");
      |         ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before 'cout'
   11 |           ans = "Yes"
      |                      ^
      |                      ;
   12 |           cout << ans << endl;
      |           ~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: expected unqualified-id before '(' token
   10 |                 else if(str.(0) == str.at(3) && str.at(1) == str.atg(2))
      |                             ^
a.cc:10:66: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'atg'; did you mean 'at'?
   10 |                 else if(str.(0) == str.at(3) && str.at(1) == str.atg(2))
      |                                                                  ^~~
      |                                                                  at
a.cc:11:22: error: expected ';' before 'cout'
   11 |           ans = "Yes"
      |                      ^
      |                      ;
   12 |           cout << ans << endl;
      |           ~~~~
Language: C

#include <stdio.h>
 
int main (void) {
  char s[100];
  scanf("%s",s);
  int x = 0;
  for (int i=0;i<4;i++){
  	for(int j=0;j<4;j++){
      if(s[i] == s[j]){
      	x++;
      }
    }
  }
  if(x == 2){
  	printf("Yes");
  }
  else(x != 2){
  	printf("No");
  }
}


Compiler output:
main.c: In function 'main':
main.c:17:15: error: expected ';' before '{' token
   17 |   else(x != 2){
      |               ^
      |               ;
Language: C

#include <stdio.h>
 
int main (void) {
  char s[100];
  scanf("%s",s);
  int x = 0;
  for (int i=0;i<4;i++){
  	for(int j=0;j<4;j++){
      if(s[i] == s[j]){
      	x++;
      }
  }
  if(x == 2){
  	printf("Yes");
  }
  else if(x != 2){
  	printf("No");
  }
}


Compiler output:
main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C

#include <stdio.h>
 
int main (void) {
  char s[100];
  scanf("%s"s);
  int x = 0;
  for (i=0;i<4;i++){
  	for(j=0;j<4;j++){
      if(s[i] == s[j]){
      	x++;
      }
  }
  if(x == 2){
  	printf("Yes");
  }
  else if(x != 2){
  	printf("No");
  }
}

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected ')' before 's'
    5 |   scanf("%s"s);
      |        ~    ^
      |             )
main.c:7:8: error: 'i' undeclared (first use in this function)
    7 |   for (i=0;i<4;i++){
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:13: error: 'j' undeclared (first use in this function)
    8 |         for(j=0;j<4;j++){
      |             ^
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C

#include <stdio.h>
 
int main (void) {
  char s[100];
  scanf("%s"s);
  int x = 0;
  for (i=0;i<4;i++){
  	for(j=0;j<4;j++){
      if(s[i] == s[j]){
      	x++
      }
  }
  if(x == 2){
  	printf("Yes")
  }
  else if(x != 2){
  	printf("No")
  }
}

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected ')' before 's'
    5 |   scanf("%s"s);
      |        ~    ^
      |             )
main.c:7:8: error: 'i' undeclared (first use in this function)
    7 |   for (i=0;i<4;i++){
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:13: error: 'j' undeclared (first use in this function)
    8 |         for(j=0;j<4;j++){
      |             ^
main.c:10:12: error: expected ';' before '}' token
   10 |         x++
      |            ^
      |            ;
   11 |       }
      |       ~     
main.c:14:22: error: expected ';' before '}' token
   14 |         printf("Yes")
      |                      ^
      |                      ;
   15 |   }
      |   ~                   
main.c:17:21: error: expected ';' before '}' token
   17 |         printf("No")
      |                     ^
      |                     ;
   18 |   }
      |   ~                  
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C++

s = input()
c = {}
for e in s:
    if e in c:
        c[e] += 1
    else:
        c[e] = 1

print("Yes" if all(map(lambda x: x == 2, c.values())) else "No")


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for e in s:
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
  int j = 0;
  for(int i = 0; i < 3; i++){
 
    if(S.at(0) == S.at(i + 1))
      j++;  
  }
  int l = 0;
  if(j == 1){
  for(int k = 0; k < 3; k++){
      if(S.at(0) != S.at(k + 1))
        l++;
  }
      if(l == 1)
      cout << "Yes" << endl;
      else
      {
          cout << "No" << endl;
      }
   else
   {
       cout << "No" << endl;
   }     
  }
  


Compiler output:
a.cc: In function 'int main()':
a.cc:24:4: error: expected '}' before 'else'
   24 |    else
      |    ^~~~
a.cc:13:13: note: to match this '{'
   13 |   if(j == 1){
      |             ^
Language: C++

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

int main(){
    string str;
    const char* cstr;
    cin >> str;

    cstr = str.c_str();

    char a, b;

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

Compiler output:
a.cc:20:6: error: expected unqualified-id before 'else'
   20 |     }else{
      |      ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
#define pll              pair <long long,long long>
#define pb               push_back
#define ll               long long
#define ff               first
#define ss               second
#define D(x)             cerr<<#x " = "<<(x)<<endl
#define vll              vector <ll>
#define IOS              ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl             '\n'   
using namespace std;

int main()
{
    IOS
   	string s;
  	cin>>s;
  map<char,ll>mp;
  for(char c:mp)mp[c]++;
  if(mp.size()==2)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: cannot convert 'std::pair<const char, long long int>' to 'char' in initialization
   22 |   for(char c:mp)mp[c]++;
      |              ^~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'S' was not declared in this scope
    4 |   cin >> S;
      |          ^
a.cc:7:5: error: break statement not within loop or switch
    7 |     break;
      |     ^~~~~
a.cc:11:5: error: break statement not within loop or switch
   11 |     break;
      |     ^~~~~
a.cc:15:5: error: break statement not within loop or switch
   15 |     break;
      |     ^~~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: expected ';' before 'return'
   18 |       cout<<"No"
      |                 ^
      |                 ;
   19 |         return 0;
      |         ~~~~~~
Language: C++

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

	}
	if (k == '\0')
	{
		printf("No");
	}

	else
	{
		printf("Yes");
	}

}


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

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

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

#include <stdio.h>

int main(void){
    char first, second, third, forth;
    scanf("%s" "%s" "%s" "%s", &first, &second, &third, &forth); 
    if(first == second && first != third && third == forth){
        printf("Yes"/n);
    }
    else if(first == third && first != second && second == forth){
        printf("Yes"/n);
    }
    else if(first == forth && first != second && third == second){
        printf("Yes"/n);
    }
    else{
        printf("No"/n);
    }
}

Compiler output:
main.c: In function 'main':
main.c:7:22: error: 'n' undeclared (first use in this function)
    7 |         printf("Yes"/n);
      |                      ^
main.c:7:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	string s;
	int a=0,b=0;
	char c,h;
	cin>>s;
	for(int i=0;i<s.size();i++){
		c=s[0];
		if(s[i]!=c){
			h=s[i];
		}
	}
	for(int i=0;i<s.size();i++){
		if(s[i]==c){
			a++;
		}
		else if(s[i]==h){
			b++;
		}
	}
	if(a==b&&a==2v){
		cout<<"Yes"<<endl;
	}
	else
		cout<<"No"<<endl;
	
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: unable to find numeric literal operator 'operator""v'
   23 |         if(a==b&&a==2v){
      |                     ^~
Language: C++

#include <algorithm>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>

using namespace std;

typedef long long int lint;

lint nCr(lint n, lint r) {
	lint res = 1;
	for (; r >= 1;) {
		res *= n--;
		res /= r--;
	}
	return res;
}

int main() {
	int n, k;
	cin >> n >> k;
	int blue = k;
	int red = n - k;

	for (int i = 1; i <= k; i++) {
		cout << nCr(red + 1, i) * nCr(blue - 1, i - 1) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope
   25 |         cin >> n >> k;
      |         ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include <cmath>
  +++ |+#include <iostream>
    9 | 
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << nCr(red + 1, i) * nCr(blue - 1, i - 1) << endl;
      |                 ^~~~
a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:67: error: 'endl' was not declared in this scope
   30 |                 cout << nCr(red + 1, i) * nCr(blue - 1, i - 1) << endl;
      |                                                                   ^~~~
a.cc:9:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    8 | #include <cmath>
  +++ |+#include <ostream>
    9 |
Language: C

#include <stdio.h>
#include <stdbool.h>
int main(){
  char S[5];
  scanf("%s",S);
  bool p= false;
  for(int i = 0;i < 4i++){
    for(int j = i;j < 4;j++){
    if(S[i] == S[j] && p == false){p =true}
    }
  }
 p == true ? printf("Yes") : printf("No");
}

Compiler output:
main.c: In function 'main':
main.c:7:23: error: lvalue required as increment operand
    7 |   for(int i = 0;i < 4i++){
      |                       ^~
main.c:7:25: error: expected ';' before ')' token
    7 |   for(int i = 0;i < 4i++){
      |                         ^
      |                         ;
main.c:9:43: error: expected ';' before '}' token
    9 |     if(S[i] == S[j] && p == false){p =true}
      |                                           ^
Language: C

#include <stdio.h>

int main(int argc, char **argv)
{
  char s[4];
  fgets(s, sizeof(s), stdin);
  
  int tbl[256] = {0};
  int i;
  for (i = 0; i < 4; i++)
  {
    tbl[s[i]]++;
  }
  
  for (i = 0; i < 256; i++)
  {
    if (tbl[i] != 0 && tbl[i] != 2)
    {
      printf("No");
      return 0;
    }
  }
  
  printf("Yes")
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:16: error: expected ';' before 'return'
   24 |   printf("Yes")
      |                ^
      |                ;
   25 |   return 0;
      |   ~~~~~~
Language: C++

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

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


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