Language: C

#include<stdio.h>
#include<string.h>
 
struct dice
{
    int n[6] ; //number
};
struct dice dice1 ;
 
 
int east()
{
    int mem = 0 ;
    mem = dice1.n[0] ;
    dice1.n[0] = dice1.n[3] ;
    dice1.n[3] = dice1.n[5] ;
    dice1.n[5] = dice1.n[2] ;
    dice1.n[2] = mem ;
}
 
int west()
{
    int mem = 0 ;
    mem = dice1.n[0] ;
    dice1.n[0] = dice1.n[2] ;
    dice1.n[2] = dice1.n[5] ;
    dice1.n[5] = dice1.n[3] ;
    dice1.n[3] = mem ;
}
 
int south()
{
    int mem = 0 ;
    mem = dice1.n[0] ;
    dice1.n[0] = dice1.n[4] ;
    dice1.n[4] = dice1.n[5] ;
    dice1.n[5] = dice1.n[1] ;
    dice1.n[1] = mem ;
}
 
int north()
{
    int mem = 0 ;
    mem = dice1.n[0] ;
    dice1.n[0] = dice1.n[1] ;
    dice1.n[1] = dice1.n[5] ;
    dice1.n[5] = dice1.n[4] ;
    dice1.n[4] = mem ;
}
 
int main()
{
    int i=0 ;
    int cmp=0 ;
 
    char a[101] = {0} ;
 
    for (i=0 ;i < 6 ;i++)
    {
        scanf("%d" ,&cmp) ;
 
        dice1.n[i] = cmp ;
 
    }
    scanf("%s" ,a) ;
 
    for (i=0 ;i < 101 ;i++)
    {
        if (a[i] == '\0') break ;
 
        if (strcmp(a[i]=='E')) east() ;
        if (strcmp(a[i]=='W')) west() ;
        if (strcmp(a[i]=='S')) south() ;
        if (strcmp(a[i]=='N')) north() ;
 
    }
 
    printf ("%d\n" ,dice1.n[0]) ;
    return 0 ;
}


Compiler output:
main.c: In function 'main':
main.c:71:24: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   71 |         if (strcmp(a[i]=='E')) east() ;
      |                    ~~~~^~~~~
      |                        |
      |                        int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:71:13: error: too few arguments to function 'strcmp'
   71 |         if (strcmp(a[i]=='E')) east() ;
      |             ^~~~~~
/usr/include/string.h:156:12: note: declared here
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |            ^~~~~~
main.c:72:24: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   72 |         if (strcmp(a[i]=='W')) west() ;
      |                    ~~~~^~~~~
      |                        |
      |                        int
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:72:13: error: too few arguments to function 'strcmp'
   72 |         if (strcmp(a[i]=='W')) west() ;
      |             ^~~~~~
/usr/include/string.h:156:12: note: declared here
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |            ^~~~~~
main.c:73:24: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   73 |         if (strcmp(a[i]=='S')) south() ;
      |                    ~~~~^~~~~
      |                        |
      |                        int
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:73:13: error: too few arguments to function 'strcmp'
   73 |         if (strcmp(a[i]=='S')) south() ;
      |             ^~~~~~
/usr/include/string.h:156:12: note: declared here
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |            ^~~~~~
main.c:74:24: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   74 |         if (strcmp(a[i]=='N')) north() ;
      |                    ~~~~^~~~~
      |                        |
      |                        int
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:74:13: error: too few arguments to function 'strcmp'
   74 |         if (strcmp(a[i]=='N')) north() ;
      |             ^~~~~~
/usr/include/string.h:156:12: note: declared here
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |            ^~~~~~