Language: C

#include <stdio.h>
         
typedef struct dice{
  int up;
  int front;
  int right;
  int left;
  int back;
  int down;
} dice;
      
dice *rotate(dice *d,char c){
  int temp;
     
  if(c=='N'){
    temp=d->front;
    d->front=d->down;
    d->down=d->back;
    d->back=d->up;
    d->up=temp;
  } else if(c=='S') {
    temp=d->back;
    d->back=d->down;
    d->down=d->front;
    d->front=d->up;
    d->up=temp;
  } else if(c=='E') {
    temp=d->left;
    d->left=d->down;
    d->down=d->right;
    d->right=d->up;
    d->up=temp;
  } else if(c=='W') {
    temp=d->right;
    d->right=d->down;
    d->down=d->left;
    d->left=d->up;
    d->up=temp;
  }
      
  return d;
}
 
int dice_judge(dice *d){
  int num=0;
 
  if(d->up==d->front)  num++;
  if(d->up==d->right)  num++;
  if(d->up==d->back)  num++;
  if(d->up==d->left)  num++;
  if(d->up==d->down)  num++;
  if(d->front==d->right)  num++;
  if(d->front==d->back)  num++;
  if(d->front==d->left)  num++;
  if(d->front==d->down)  num++;
  if(d->right==d->back)  num++;
  if(d->right==d->left)  num++;
  if(d->right==d->down)  num++;
  if(d->back==d->left)  num++;
  if(d->back==d->down)  num++;
  if(d->left==d->down)  num++;
 
  return num;
}
    
int main(void){
  dice d1,d2;
  dice *root;
  int judge;
          
  root=&d1;
  scanf("%d%d%d%d%d%d",&d1.up,&d1.front,&d1.right,&d1.left,&d1.back,&d1.down);
  scanf("%d%d%d%d%d%d",&d2.up,&d2.front,&d2.right,&d2.left,&d2.back,&d2.down);
 
  judge=dice_judge(root);
  if(judge>=10){
    printf("Yes\n");  exit 1;
  }
 
  root=&d2;
  if(d1.up==d2.up) ;
  else if(d1.up==d2.front)  root=rotate(root,'N');
  else if(d1.up==d2.right)  root=rotate(root,'W');
  else if(d1.up==d2.left)  root=rotate(root,'E');
  else if(d1.up==d2.back)  root=rotate(root,'S');
  else if(d1.up==d2.down){
    root=rotate(root,'N');  root=rotate(root,'N');
  }
      
  if(d1.front==d2.down)  printf("No\n");
  else if(d1.front==d2.front){
    if(d1.right==d2.right && d1.back==d2.back && d1.left==d2.left)  printf("Yes\n");
    else printf("No\n");
  } else if (d1.front==d2.right) {
    if(d1.right==d2.back && d1.back==d2.left && d1.left==d2.front)  printf("Yes\n");
    else printf("No\n");
  } else if(d1.front==d2.back) {
    if(d1.right==d2.left && d1.back==d2.front && d1.left==d2.right)  printf("Yes\n");
    else printf("No\n");
  } else if(d1.front==d2.left) {
    if(d1.right==d2.front && d1.back==d2.right && d1.left==d2.back)  printf("Yes\n");
    else printf("No\n");
  }
   
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:77:23: error: 'exit' undeclared (first use in this function)
   77 |     printf("Yes\n");  exit 1;
      |                       ^~~~
main.c:2:1: note: 'exit' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:77:23: note: each undeclared identifier is reported only once for each function it appears in
   77 |     printf("Yes\n");  exit 1;
      |                       ^~~~
main.c:77:27: error: expected ';' before numeric constant
   77 |     printf("Yes\n");  exit 1;
      |                           ^~
      |                           ;