Language: Java

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

#define vi vector<int>
#define p pair<int, int>
#define REP(i, n) for(int i = 0;i < n; i++)
#define FOR(i, m, n) for(int i = m;i < n; i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define BR cout << endl;
#define INF  2000000000

int a[6], sum = 0;

int main(){
    char a, b, c, d;
    cin >> a >> b >> c >> d;
    if((a == b && b == c) || b == c && c == d){
        Yes
    }else{
        No
    }
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <vector>
^
Main.java:3: error: illegal character: '#'
#include <string>
^
Main.java:4: error: illegal character: '#'
#include <cstdio>
^
Main.java:5: error: illegal character: '#'
#include <cmath>
^
Main.java:6: error: illegal character: '#'
#include <algorithm>
^
Main.java:9: error: illegal character: '#'
#define vi vector<int>
^
Main.java:9: error: class, interface, enum, or record expected
#define vi vector<int>
        ^
Main.java:10: error: illegal character: '#'
#define p pair<int, int>
^
Main.java:11: error: illegal character: '#'
#define REP(i, n) for(int i = 0;i < n; i++)
^
Main.java:11: error: class, interface, enum, or record expected
#define REP(i, n) for(int i = 0;i < n; i++)
                                ^
Main.java:11: error: class, interface, enum, or record expected
#define REP(i, n) for(int i = 0;i < n; i++)
                                       ^
Main.java:12: error: illegal character: '#'
#define FOR(i, m, n) for(int i = m;i < n; i++)
^
Main.java:12: error: class, interface, enum, or record expected
#define FOR(i, m, n) for(int i = m;i < n; i++)
                                   ^
Main.java:12: error: class, interface, enum, or record expected
#define FOR(i, m, n) for(int i = m;i < n; i++)
                                          ^
Main.java:13: error: illegal character: '#'
#define YES cout << "YES" << endl;
^
Main.java:14: error: illegal character: '#'
#define NO cout << "NO" << endl;
^
Main.java:14: error: class, interface, enum, or record expected
#define NO cout << "NO" << endl;
        ^
Main.java:15: error: illegal character: '#'
#define Yes cout << "Yes" << endl;
^
Main.java:15: error: class, interface, enum, or record expected
#define Yes cout << "Yes" << endl;
        ^
Main.java:16: error: illegal character: '#'
#define No cout << "No" << endl;
^
Main.java:16: error: class, interface, enum, or record expected
#define No cout << "No" << endl;
        ^
Main.java:17: error: illegal character: '#'
#define BR cout << endl;
^
Main.java:17: error: class, interface, enum, or record expected
#define BR cout << endl;
        ^
Main.java:18: error: illegal character: '#'
#define INF  2000000000
^
Main.java:18: error: class, interface, enum, or record expected
#define INF  2000000000
        ^
Main.java:24: error: not a statement
    cin >> a >> b >> c >> d;
                       ^
Main.java:26: error: not a statement
        Yes
        ^
Main.java:28: error: not a statement
        No
        ^
Main.java:22: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:26: error: ';' expected
        Yes
           ^
Main.java:28: error: ';' expected
        No
          ^
32 errors