Language: C++

#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

class Dice {
      private:
              int value[6];
  
      public:             
              Dice(int value[]) {             
                   for (int i = 0; i < 6; i++) {
                        this->value[i] = value[i];
                   }                  
              }
              
              void swap(int& a, int& b) {
                   int temp = a;
                   a = b;
                   b = temp;
              }

              void move_N(int value[]) {
                   this->swap(value[0], value[1]);
                   this->swap(value[1], value[5]);
                   this->swap(value[5], value[4]);
              }

              void move_E(int value[]) {
                   this->swap(value[0], value[3]);
                   this->swap(value[3], value[5]);
                   this->swap(value[5], value[2]);
              }

              void move_W(int value[]) {
                   this->swap(value[0], value[2]);
                   this->swap(value[2], value[5]);
                   this->swap(value[5], value[3]);
              }

              void move_S(int value[]) {
                   this->swap(value[0], value[4]);
                   this->swap(value[4], value[5]);
                   this->swap(value[5], value[1]);
              }      

              int Get_value(int i) {
                  return (this->value[i]);
              }                      
};

int same_side(Dice dice1, Dice dice2);

int main()
{
    long i, j;
    int  value[2][6];  
    
    for (i = 0; i < 2; i++) {
         for (j = 0; j < 6; j++) {
              do {
                  cin >> value[i][j];
              } while (value[i][j] < 0 || value[i][j] > 100);
         }
    }

    Dice dice1(value[0]);
    Dice dice2(value[1]);

    while (1) {
           srand(time(NULL));

           if (dice1.Get_value(0) == dice2.Get_value(0)) {
               break;
           } else {
               if (rand() % 4 == 0) {
                   dice2.move_N(value[1]);
               } else if (rand() % 4 == 1) {
                   dice2.move_E(value[1]);
               } else if (rand() % 4 == 2) {
                   dice2.move_W(value[1]);
               } else if (rand() % 4 == 3) {
                   dice2.move_S(value[1]);
               }  
           }                
    }
    
    if (same_side(dice1, dice2) == 1) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
  
    return (0);
}

int same_side(Dice dice1, Dice dice2)
{
    int i;
 
    while (1) {
           if (dice1.Get_value(dice1.value) != dice2.Get_value(dice2.value)) {
               dice2.move_S(dice2.value);
               dice2.move_E(dice2.value);
               dice2.move_N(dice2.value);
           } else {
               break;
           }
    }

    for (i = 2; i < 4; i++) {
         if (dice1.Get_value(i) != dice2.Get_value(i)) {
             break;
         }
    }

    if (i == 5) {
        return (1);
    } else {
        return (0);
    }
}
    

Compiler output:
a.cc: In function 'int same_side(Dice, Dice)':
a.cc:103:38: error: 'int Dice::value [6]' is private within this context
  103 |            if (dice1.Get_value(dice1.value) != dice2.Get_value(dice2.value)) {
      |                                      ^~~~~
a.cc:9:19: note: declared private here
    9 |               int value[6];
      |                   ^~~~~
a.cc:103:38: error: invalid conversion from 'int*' to 'int' [-fpermissive]
  103 |            if (dice1.Get_value(dice1.value) != dice2.Get_value(dice2.value)) {
      |                                ~~~~~~^~~~~
      |                                      |
      |                                      int*
a.cc:48:33: note:   initializing argument 1 of 'int Dice::Get_value(int)'
   48 |               int Get_value(int i) {
      |                             ~~~~^
a.cc:103:70: error: 'int Dice::value [6]' is private within this context
  103 |            if (dice1.Get_value(dice1.value) != dice2.Get_value(dice2.value)) {
      |                                                                      ^~~~~
a.cc:9:19: note: declared private here
    9 |               int value[6];
      |                   ^~~~~
a.cc:103:70: error: invalid conversion from 'int*' to 'int' [-fpermissive]
  103 |            if (dice1.Get_value(dice1.value) != dice2.Get_value(dice2.value)) {
      |                                                                ~~~~~~^~~~~
      |                                                                      |
      |                                                                      int*
a.cc:48:33: note:   initializing argument 1 of 'int Dice::Get_value(int)'
   48 |               int Get_value(int i) {
      |                             ~~~~^
a.cc:104:35: error: 'int Dice::value [6]' is private within this context
  104 |                dice2.move_S(dice2.value);
      |                                   ^~~~~
a.cc:9:19: note: declared private here
    9 |               int value[6];
      |                   ^~~~~
a.cc:105:35: error: 'int Dice::value [6]' is private within this context
  105 |                dice2.move_E(dice2.value);
      |                                   ^~~~~
a.cc:9:19: note: declared private here
    9 |               int value[6];
      |                   ^~~~~
a.cc:106:35: error: 'int Dice::value [6]' is private within this context
  106 |                dice2.move_N(dice2.value);
      |                                   ^~~~~
a.cc:9:19: note: declared private here
    9 |               int value[6];
      |                   ^~~~~