Language: Java

#include<iostream>
 
using namespace std;
 
 
class DICE {
    enum {
        Top,
        Front,
        Right,
        Left,
        Rear,
        Bottom
    };
 
    void Roll(const char*Directions) {
        for (int i = 0; Directions[i] != '\0'; i++) {
            Roll(Directions[i]);
        }
    }
 
    void Roll(const char Direction) {
        int tmpTop = Num[Top];
 
        switch (Direction) {
        case'E':
            Num[Top] = Num[Left];
            Num[Left] = Num[Bottom];
            Num[Bottom] = Num[Right];
            Num[Right] = Num[tmpTop];
            break;
        case'N':
            Num[Top] = Num[Front];
            Num[Front] = Num[Bottom];
            Num[Bottom] = Num[Rear];
            Num[Rear] = tmpTop;
            break;
        case'S':
            Num[Top] = Num[Rear];
            Num[Rear] = Num[Bottom];
            Num[Bottom] = Num[Front];
            Num[Front] = tmpTop;
            break;
        case'W':
            Num[Top] = Num[Right];
            Num[Right] = Num[Bottom];
            Num[Bottom] = Num[Left];
            Num[Left] = tmpTop;
            break;
        }
    }
 
    bool SameDiceDirectionFlag(DICE Dice) {
        for (int i = 0; i < 6; i++) {
            if (Num[i] != Dice.Num[i])return false;
        }
        return true;
    }
 
public:
    int Num[6];
 
    bool SameDiceNoneDirectionFlag(DICE Dice) {
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
 
        for (int i = 0; i < 6; i++) {
            if (Num[Top] == Dice.Num[Top]) {
                for (int j = 0; j < 4; j++) {
                    if (SameDiceDirectionFlag(Dice))return true;
 
                    int tmpFront = Dice.Num[Front];
                    Dice.Num[Front] = Dice.Num[Right];
                    Dice.Num[Right] = Dice.Num[Rear];
                    Dice.Num[Rear] = Dice.Num[Left];
                    Dice.Num[Left] = tmpFront;
                }
            }
 
            Dice.Roll(Directions[i]);
        }
 
        return false;
    }
 
};
 
int main() {
    DICE Dice[101];
    int n;
 
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 6; j++)cin >> Dice[i].Num[j];
    }
 
    for (int i = 1; i < n; i++) {
        if (Dice[0].SameDiceNoneDirectionFlag(Dice[i])) {
            cout << "No" << endl;
            return 0;
        }
    }
 
    cout << "Yes" << endl;
 
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:7: error: <identifier> expected
    enum {
        ^
Main.java:16: error: illegal start of type
    void Roll(const char*Directions) {
              ^
Main.java:16: error: <identifier> expected
    void Roll(const char*Directions) {
                        ^
Main.java:16: error: <identifier> expected
    void Roll(const char*Directions) {
                                   ^
Main.java:22: error: illegal start of type
    void Roll(const char Direction) {
              ^
Main.java:22: error: ';' expected
    void Roll(const char Direction) {
                                  ^
Main.java:60: error: illegal start of type
public:
      ^
Main.java:61: error: ']' expected
    int Num[6];
            ^
Main.java:64: error: illegal start of expression
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
        ^
Main.java:64: error: ']' expected
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
                                ^
Main.java:64: error: not a statement
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
                                       ^
Main.java:64: error: ';' expected
        const char Directions[][3] = { "N","N","N","NW","WW","\0" };
                                          ^
Main.java:91: error: not a statement
    cin >> n;
        ^
Main.java:93: error: not a statement
        for (int j = 0; j < 6; j++)cin >> Dice[i].Num[j];
                                       ^
Main.java:98: error: not a statement
            cout << "No" << endl;
                         ^
Main.java:103: error: not a statement
    cout << "Yes" << endl;
                  ^
Main.java:87: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:88: error: ']' expected
    DICE Dice[101];
              ^
20 errors