Language: C

i#include <stdio.h>

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

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

int main(){
struct DICE *p;char compass;
scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(p,compass);
scanf("%c", &compass);
}
printf("%d\n",p->mark1);
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;
}
}

Compiler output:
main.c:1:2: error: stray '#' in program
    1 | i#include <stdio.h>
      |  ^
main.c:1:1: error: unknown type name 'i'
    1 | i#include <stdio.h>
      | ^
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | i#include <stdio.h>
      |           ^
main.c:7:22: warning: 'struct DICE' declared inside parameter list will not be visible outside of this definition or declaration
    7 | void MoveDice(struct DICE *p,char c);
      |                      ^~~~
main.c: In function 'main':
main.c:11:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | i#include <stdio.h>
main.c:11:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      | ^~~~~
main.c:11:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:30: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                              ^~
main.c:11:39: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                       ^~
main.c:11:48: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                ^~
main.c:11:57: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                         ^~
main.c:11:66: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                  ^~
main.c:11:75: error: invalid use of undefined type 'struct DICE'
   11 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                           ^~
main.c:14:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   14 | MoveDice(p,compass);
      |          ^
      |          |
      |          struct DICE *
main.c:7:28: note: expected 'struct DICE *' but argument is of type 'struct DICE *'
    7 | void MoveDice(struct DICE *p,char c);
      |               ~~~~~~~~~~~~~^
main.c:17:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 | printf("%d\n",p->mark1);
      | ^~~~~~
main.c:17:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:16: error: invalid use of undefined type 'struct DICE'
   17 | printf("%d\n",p->mark1);
      |                ^~
main.c: At top level:
main.c:21:22: warning: 'struct DICE' declared inside parameter list will not be visible outside of this definition or declaration
   21 | void MoveDice(struct DICE *p,char c){
      |                      ^~~~
main.c:21:6: error: conflicting types for 'MoveDice'; have 'void(struct DICE *, char)'
   21 | void MoveDice(struct DICE *p,char c){
      |      ^~~~~~~~
main.c:7:6: note: previous declaration of 'MoveDice' with type 'void(struct DICE *, char)'
    7 | void MoveDice(struct DICE *p,char c);
      |      ^~~~~~~~
main.c: In function 'MoveDice':
main.c:23:6: error: invalid use of undefined type 'struct DICE'
   23 | tmp=p->mark1;
      |      ^~
main.c:26:2: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |  ^~
main.c:26:11: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |           ^~
main.c:26:20: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |                    ^~
main.c:26:29: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |                             ^~
main.c:26:38: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |                                      ^~
main.c:26:47: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |                                               ^~
main.c:26:56: error: invalid use of undefined type 'struct DICE'
   26 | p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
      |                                                        ^~
main.c:29:2: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |  ^~
main.c:29:11: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |           ^~
main.c:29:20: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |                    ^~
main.c:29:29: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |                             ^~
main.c:29:38: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |                                      ^~
main.c:29:47: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |                                               ^~
main.c:29:56: error: invalid use of undefined type 'struct DICE'
   29 | p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
      |                                                        ^~
main.c:32:2: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |  ^~
main.c:32:11: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |           ^~
main.c:32:20: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |                    ^~
main.c:32:29: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |                             ^~
main.c:32:38: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |                                      ^~
main.c:32:47: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |                                               ^~
main.c:32:56: error: invalid use of undefined type 'struct DICE'
   32 | p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
      |                                                        ^~
main.c:35:2: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |  ^~
main.c:35:11: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |           ^~
main.c:35:20: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |                    ^~
main.c:35:29: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |                             ^~
main.c:35:38: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |                                      ^~
main.c:35:47: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |                                               ^~
main.c:35:56: error: invalid use of undefined type 'struct DICE'
   35 | p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
      |                                                        ^~