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];
              }
                                           
              int 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 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;
      |                  ^~~~~~~~~~~