Language: Java

#include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
 
struct Cube
{
    int f[6];
    Cube(){}
 
    void roll(int i,int j,int k,int l)
    {
        int t = f[i];
        f[i] = f[j];
        f[j] = f[k];
        f[k] = f[l];
        f[l] = t;
    }
 
    void roll_z() { roll(1,2,4,3); }
    void roll_y() { roll(0,2,5,3); }
    void roll_x() { roll(0,1,5,4); }
 
    void move(char c)
    {
        if(c == 'E') rep(i,3) roll_y();
        else if(c == 'W') roll_y();
        else if(c == 'N') roll_x();
        else if(c == 'S') rep(i,3) roll_x();
    }
};
 
int main()
{
    Cube c;
    string s;
    rep(i,6) cin >> c.f[i];
    cin >> s;
 
    rep(i,s.size()) c.move(s[i]);
 
    cout << c.f[0] << endl;
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <string>
^
Main.java:3: error: illegal character: '#'
#define rep(i,n) for(int i=0;i<n;i++)
^
Main.java:3: error: class, interface, enum, or record expected
#define rep(i,n) for(int i=0;i<n;i++)
                             ^
Main.java:3: error: class, interface, enum, or record expected
#define rep(i,n) for(int i=0;i<n;i++)
                                 ^
Main.java:6: error: class, interface, enum, or record expected
struct Cube
^
Main.java:9: error: class, interface, enum, or record expected
    Cube(){}
    ^
Main.java:14: error: class, interface, enum, or record expected
        f[i] = f[j];
        ^
Main.java:15: error: class, interface, enum, or record expected
        f[j] = f[k];
        ^
Main.java:16: error: class, interface, enum, or record expected
        f[k] = f[l];
        ^
Main.java:17: error: class, interface, enum, or record expected
        f[l] = t;
        ^
Main.java:18: error: class, interface, enum, or record expected
    }
    ^
Main.java:20: error: class, interface, enum, or record expected
    void roll_z() { roll(1,2,4,3); }
                                   ^
Main.java:21: error: class, interface, enum, or record expected
    void roll_y() { roll(0,2,5,3); }
                                   ^
Main.java:22: error: class, interface, enum, or record expected
    void roll_x() { roll(0,1,5,4); }
                                   ^
Main.java:27: error: class, interface, enum, or record expected
        else if(c == 'W') roll_y();
        ^
Main.java:28: error: class, interface, enum, or record expected
        else if(c == 'N') roll_x();
        ^
Main.java:29: error: class, interface, enum, or record expected
        else if(c == 'S') rep(i,3) roll_x();
        ^
Main.java:30: error: class, interface, enum, or record expected
    }
    ^
Main.java:37: error: not a statement
    rep(i,6) cin >> c.f[i];
                 ^
Main.java:38: error: not a statement
    cin >> s;
        ^
Main.java:42: error: not a statement
    cout << c.f[0] << endl;
                   ^
Main.java:33: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
Main.java:37: error: ';' expected
    rep(i,6) cin >> c.f[i];
            ^
Main.java:40: error: ';' expected
    rep(i,s.size()) c.move(s[i]);
                   ^
25 errors