Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);
void SpinDice(struct DICE *p,char c);

int main(){
struct DICE p;int cnt,flag,up,ahead,num,i;

scanf("%d %d %d %d %d %d\n",&p.mark1,&p.mark2,&p.mark3,&p.mark4,&p.mark5,&p.mark6);
scanf("%d\n", &num);
for(i=1;i<=num;i++){
 scanf("%d %d\n",&up,&ahead);
 cnt=0;flag=0;

 while(cnt<=3||flag==0){
  if(p.mark1==up){
   flag==1;
  }else{
   MoveDice(&p,'W')
   cnt++;
  }
 }
 if(flag==0){
  MoveDice(&p,'N'); 
  if(p.mark1==up){
   flag==1;
  }else{
  MoveDice(&p,'N'); 
  MoveDice(&p,'N'); 
  flag==1; 
 }
 cnt=0;flag=0;
 while(cnt<=3||flag==0){
  if(p.mark2==ahead){
   flag==1;
  }else{
   SpinDice(&p,'R');
   cnt++;
  }
 }
}
printf("%d\n",p.mark3);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}
void SpinDice(struct DICE *p,char c){
if (c=='R'){
MoveDice(&p,'W');
MoveDice(&p,'S');
MoveDice(&p,'E');
}else{
MoveDice(&p,'W');
MoveDice(&p,'N');
MoveDice(&p,'E');
}



}

Compiler output:
main.c: In function 'main':
main.c:23:20: error: expected ';' before 'cnt'
   23 |    MoveDice(&p,'W')
      |                    ^
      |                    ;
   24 |    cnt++;
      |    ~~~              
main.c: In function 'SpinDice':
main.c:70:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   70 | MoveDice(&p,'W');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c:71:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   71 | MoveDice(&p,'S');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c:72:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   72 | MoveDice(&p,'E');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c:74:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   74 | MoveDice(&p,'W');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c:75:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   75 | MoveDice(&p,'N');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c:76:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   76 | MoveDice(&p,'E');
      |          ^~
      |          |
      |          struct DICE **
main.c:50:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
   50 | void MoveDice(struct DICE *p,char c){
      |               ~~~~~~~~~~~~~^
main.c: In function 'main':
main.c:81:1: error: expected declaration or statement at end of input
   81 | }
      | ^