Language: C++

#include <iostream>
#include <string>

#define MAX_LEN (100)

using namespace std;

int all_diff(int value[]);

class Dice {
      private:
              int value[6];
              int top;
     
      public:             
              Dice(int value[]) {             
                   for (int i = 0; i < 6; i++) {
                        this->value[i] = value[i];
                   }
                   
                   this->top = value[0];
              }
                                           
              void Get_right(int top, int front) {
                   if (top == this->value[0]) {
                       if (front == this->value[1]) {
                           return (this->value[2]);
                       } else if (front == this->value[2]) {
                           return (this->value[4]);
                       } else if (front == this->value[3]) {
                           return (this->value[1]);
                       } else if (front == this->value[4]) {
                           return (this->value[3]);
                       }
                   } else if (top == this->value[1]) {
                       if (front == this->value[0]) {
                           return (this->value[3]);
                       } else if (front == this->value[2]) {
                           return (this->value[0]);
                       } else if (front == this->value[3]) {
                           return (this->value[5]);
                       } else if (front == this->value[5]) {
                           return (this->value[2]);
                       }
                   } else if (top == this->value[2]) {
                       if (front == this->value[0]) {
                           return (this->value[1]);
                       } else if (front == this->value[1]) {
                           return (this->value[5]);
                       } else if (front == this->value[4]) {
                           return (this->value[0]);
                       } else if (front == this->value[5]) {
                           return (this->value[4]);
                       }
                   } else if (top == this->value[3]) {
                       if (front == this->value[0]) {
                           return (this->value[4]);
                       } else if (front == this->value[1]) {
                           return (this->value[0]);
                       } else if (front == this->value[4]) {
                           return (this->value[5]);
                       } else if (front == this->value[5]) {
                           return (this->value[1]);
                       }
                   } else if (top == this->value[4]) {
                       if (front == this->value[0]) {
                           return (this->value[2]);
                       } else if (front == this->value[2]) {
                           return (this->value[5]);
                       } else if (front == this->value[3]) {
                           return (this->value[0]);
                       } else if (front == this->value[5]) {
                           return (this->value[3]);
                       }
                   } else if (top == this->value[5]) {
                       if (front == this->value[1]) {
                           return (this->value[3]);
                       } else if (front == this->value[2]) {
                           return (this->value[1]);
                       } else if (front == this->value[3]) {
                           return (this->value[4]);
                       } else if (front == this->value[4]) {
                           return (this->value[2]);
                       }
                  }
              }
};

int main()
{
    int value[6];  
    int q;   
       
    do {
        do {
            cin >> value[1];
        } while (value[i] < 0 || value[i] > 100);
    } while (all_diff(value) == 0);    

    Dice dice(value);

    do {
        cin >> q;
    } while (q < 1 || q > 24);

    int* top = new int[q];
    int* front = new int[q];
  
    for (int i = 0; i < q; i++) {
         do {
             cin >> top[i] >> front[i];
         } 
    }
   
    for (int i = 0; i < q; i++) {
         cout << print_right(top[i], front[i]) << endl;
    }

    delete[] top;
    delete[] front; 
 
    return (0);
}

int all_diff(int value[])
{
    int i;
    int flag[MAX_LEN] = {0};

    for (i = 0; i < 6; i++) {
         if (i >= 1) {
             if (flag[value[i] - 1] == 1) {
                 break;
             }
         }

         flag[value[i] - 1] = 1;  
    }

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

Compiler output:
a.cc: In member function 'void Dice::Get_right(int, int)':
a.cc:27:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   27 |                            return (this->value[2]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:29:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   29 |                            return (this->value[4]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:31:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   31 |                            return (this->value[1]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:33:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   33 |                            return (this->value[3]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:37:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   37 |                            return (this->value[3]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:39:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   39 |                            return (this->value[0]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:41:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   41 |                            return (this->value[5]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:43:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   43 |                            return (this->value[2]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:47:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   47 |                            return (this->value[1]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:49:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   49 |                            return (this->value[5]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:51:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   51 |                            return (this->value[0]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:53:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   53 |                            return (this->value[4]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:57:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   57 |                            return (this->value[4]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:59:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   59 |                            return (this->value[0]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:61:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   61 |                            return (this->value[5]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:63:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   63 |                            return (this->value[1]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:67:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   67 |                            return (this->value[2]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:69:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   69 |                            return (this->value[5]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:71:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   71 |                            return (this->value[0]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:73:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   73 |                            return (this->value[3]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:77:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   77 |                            return (this->value[3]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:79:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   79 |                            return (this->value[1]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:81:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   81 |                            return (this->value[4]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc:83:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
   83 |                            return (this->value[2]);
      |                                   ~~~~~~~~~~~~~~^~
a.cc: In function 'int main()':
a.cc:97:24: error: 'i' was not declared in this scope
   97 |         } while (value[i] < 0 || value[i] > 100);
      |                        ^
a.cc:113:5: error: expected 'while' before '}' token
  113 |     }
      |     ^
a.cc:113:5: error: expected '(' before '}' token
  113 |     }
      |     ^
      |     (
a.cc:113:5: error: expected primary-expression before '}' token
a.cc:112:11: error: expected ')' before '}' token
  112 |          }
      |           ^
      |           )
  113 |     }
      |     ~      
a.cc:112:11: error: expected ';' before '}' token
  112 |          }
      |           ^
      |           ;
  113 |     }
      |     ~      
a.cc:116:18: error: 'print_right' was not declared in this scope
  116 |          cout << print_right(top[i], front[i]) << endl;
      |                  ^~~~~~~~~~~