Language: C++

 int f[6];
 Dice(){}

 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_x(){ roll(0, 1, 5, 4 );}
 void roll_y(){ roll(0, 2, 5, 3 );}
 void roll_z(){ roll(1, 2, 4, 3 );}
};

bool eq( Dice p1, Dice p2){
  for( int i = 0; i < 6; i++){if( p1.f[i] != p2.f[i]) return false;}
  return true;
}

bool eqa(Dice p1, Dice p2){
	   for( int i = 0; i < 6; i++){
		    for( int j = 0; j < 4; j++){
			     if( eq(p1, p2) ) return true;
			     p1.roll_z();
	    }
		     if( i % 2 == 0) p1.roll_y();
		     else p1.roll_x();
            }
          return false;
}

int main(){
  Dice p1, p2;

  for( int i = 0; i < 6; i++){ cin >> p1.f[i];}
  for( int i = 0; i < 6; i++){ cin >> p2.f[i];}

  if( eqa( p1, p2) cout >> "Yes" >> endl;
  else cout >> "No" >> endl;
		  
  return 0;
}
	   

Compiler output:
a.cc:2:2: error: ISO C++ forbids declaration of 'Dice' with no type [-fpermissive]
    2 |  Dice(){}
      |  ^~~~
a.cc: In function 'int Dice()':
a.cc:2:9: warning: no return statement in function returning non-void [-Wreturn-type]
    2 |  Dice(){}
      |         ^
a.cc: At global scope:
a.cc:10:1: error: expected declaration before '}' token
   10 | };
      | ^
a.cc:12:14: error: expected ')' before 'p1'
   12 | bool eq( Dice p1, Dice p2){
      |        ~     ^~~
      |              )
a.cc:12:23: error: expected ')' before 'p2'
   12 | bool eq( Dice p1, Dice p2){
      |        ~              ^~~
      |                       )
a.cc:12:26: error: expression list treated as compound expression in initializer [-fpermissive]
   12 | bool eq( Dice p1, Dice p2){
      |                          ^
a.cc:12:27: error: expected ',' or ';' before '{' token
   12 | bool eq( Dice p1, Dice p2){
      |                           ^
a.cc:17:14: error: expected ')' before 'p1'
   17 | bool eqa(Dice p1, Dice p2){
      |         ~    ^~~
      |              )
a.cc:17:23: error: expected ')' before 'p2'
   17 | bool eqa(Dice p1, Dice p2){
      |         ~             ^~~
      |                       )
a.cc:17:26: error: expression list treated as compound expression in initializer [-fpermissive]
   17 | bool eqa(Dice p1, Dice p2){
      |                          ^
a.cc:17:27: error: expected ',' or ';' before '{' token
   17 | bool eqa(Dice p1, Dice p2){
      |                           ^
a.cc: In function 'int main()':
a.cc:30:7: error: expected ';' before 'p1'
   30 |   Dice p1, p2;
      |       ^~~
      |       ;
a.cc:32:32: error: 'cin' was not declared in this scope
   32 |   for( int i = 0; i < 6; i++){ cin >> p1.f[i];}
      |                                ^~~
a.cc:32:39: error: 'p1' was not declared in this scope
   32 |   for( int i = 0; i < 6; i++){ cin >> p1.f[i];}
      |                                       ^~
a.cc:33:32: error: 'cin' was not declared in this scope
   33 |   for( int i = 0; i < 6; i++){ cin >> p2.f[i];}
      |                                ^~~
a.cc:33:39: error: 'p2' was not declared in this scope
   33 |   for( int i = 0; i < 6; i++){ cin >> p2.f[i];}
      |                                       ^~
a.cc:35:12: error: 'p1' was not declared in this scope
   35 |   if( eqa( p1, p2) cout >> "Yes" >> endl;
      |            ^~
a.cc:35:16: error: 'p2' was not declared in this scope
   35 |   if( eqa( p1, p2) cout >> "Yes" >> endl;
      |                ^~
a.cc:35:18: error: 'eqa' cannot be used as a function
   35 |   if( eqa( p1, p2) cout >> "Yes" >> endl;
      |                  ^
a.cc:36:3: error: expected primary-expression before 'else'
   36 |   else cout >> "No" >> endl;
      |   ^~~~
a.cc:35:42: error: expected ')' before 'else'
   35 |   if( eqa( p1, p2) cout >> "Yes" >> endl;
      |     ~                                    ^
      |                                          )
   36 |   else cout >> "No" >> endl;
      |   ~~~~