criyle/codenet-compile-errors huggingface dataset:
Language: C

  #include "stdio.h"
  #include "string.h"
  #define DICE 4
  const int shokiti[4][4]={{1,2,6,5},{1,4,6,3},{1,5,6,2},{1,3,6,4}};
  int zorome[4][4];
  int cp[4];
  unsigned long sum;
  void direction(constint de){
      int tmp[2],i,m,j;
      m=(de>=2)?de-2:de+2;
      j=(m+de)/2%2;
      tmp[0]=zorome[de][0];
      tmp[1]=zorome[m][3];
      for(i=1;i<DICE;i++){
          zorome[de][i-1]=zorome[de][i];
          zorome[m][DICE-i]=zorome[m][DICE-i-1];
      }
      zorome[de][3]=tmp[0];
      zorome[m][0]= zorome[j][0]=zorome[j+2][0]=tmp[1];
      zorome[j][2]=zorome[j+2][2]=zorome[de][2];
      sum+=(unsigned long)zorome[m][0];
  }
  void rotation(const int de){
       int i,m;
          for(i=0;i<DICE;i++){
              cp[i]=zorome[de][i];
          }
           for(m=0;m<DICE;m++){                                  
for(i=0;i<DICE;i++){
                   zorome[(de)?DICE-m-1:m][i]=zorome[(de)?DICE-m-    2:m+1][i];
              }
           }
          for(i=0;i<DICE;i++){
              zorome[(de)?0:3][i]= cp[i];
          }
            sum+=(unsigned long)zorome[de][0];
  }
  
  int main(void){
      int i,n;
      char ch[100];
  do{
      for(i=0;i<DICE;i++){
            for(n=0;n<DICE;n++){
                zorome[i][n]=shokiti[i][n];   
 }
      }
      sum=0;
      scanf("%d",&n);
      for(i=0;i<n;i++){
          scanf("%s",ch);
        if(strcmp(ch,"North")==0){
              direction(0);
          }else if(strcmp(ch,"East")==0){
              direction(1);
          }else if(strcmp(ch,"South")==0){
              direction(2);
          }else if(strcmp(ch,"West")==0){
              direction(3);
          }else if(strcmp(ch,"Right")==0){
              rotation(3);
          }else if(strcmp(ch,"Left")==0){
              rotation(0);
          }
  }
	if(n)
      printf("%lu\n",sum+1);
  }while(n);  
      return 0;
 }
                                   

Compiler output:
main.c:8:18: error: unknown type name 'constint'
    8 |   void direction(constint de){
      |                  ^~~~~~~~
main.c: In function 'main':
main.c:53:15: error: implicit declaration of function 'direction' [-Wimplicit-function-declaration]
   53 |               direction(0);
      |               ^~~~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
	int n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1;
	char muki[10];
	scanf_s("%d", &n);
	for (int i = 0; i<n; i++){
		scanf_s("%s", muki,10);
		if (strcmp(muki , "North")==0){
			n1 = z1;
			z1 = 7 - b;
			b = n1;
		}
		if (strcmp(muki, "East") == 0){
			n1 = 7 - z2;
			z2 = b;
			b = n1;
		}
		if (strcmp(muki, "West") == 0){
			n1 = z2;
			z2 = 7 - b;
			b = n1;
		}
		if (strcmp(muki, "South") == 0){
			n1 = 7 - z1;
			z1 = b;
			b = n1;
		}
		if (strcmp(muki, "Right") == 0){
			n2 = 7 - z1;
			z1 = z2;
			z2 = n2;
		}
		if (strcmp(muki, "Left") == 0){
			n2 = z1;
			z1 = 7 - z2;
			z2 = n2;
		}
		g += b;
	}
	printf("%d", g);
	scanf_s("%d", &n1);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
	int i,n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1;
	char muki[10];
	scanf_s("%d", &n);
	for (i = 0; i<n; i++){
		scanf_s("%s", muki,10);
		if (strcmp(muki , "North")==0){
			n1 = z1;
			z1 = 7 - b;
			b = n1;
		}
		if (strcmp(muki, "East") == 0){
			n1 = 7 - z2;
			z2 = b;
			b = n1;
		}
		if (strcmp(muki, "West") == 0){
			n1 = z2;
			z2 = 7 - b;
			b = n1;
		}
		if (strcmp(muki, "South") == 0){
			n1 = 7 - z1;
			z1 = b;
			b = n1;
		}
		if (strcmp(muki, "Right") == 0){
			n2 = 7 - z1;
			z1 = z2;
			z2 = n2;
		}
		if (strcmp(muki, "Left") == 0){
			n2 = z1;
			z1 = 7 - z2;
			z2 = n2;
		}
		g += b;
	}
	printf("%d", g);
	scanf_s("%d", &n1);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int t,r;
char s[6];
void f(n){
	int d[5]={1,3,4,2,5};
	int i;
	for(i=0;i<n;i++){
		scanf("%s",s);
		switch(s[0]){
		case 'N':d[0]=d[3];d[3]=7-d[0];d[4]=7-d[3];break;
		case 'S':d[3]=d[0];d[0]=d[4];d[4]=7-d[3];break;
		case 'E':d[1]=d[0];d[0]=d[2];d[2]=7-d[1];break;
????????????????case 'W':d[2]=d[0];d[0]=d[1];d[1]=7-d[2];break;
????????????????case 'R':t=d[3];d[3]=d[1];d[1]=d[4];d[4]=d[2];d[2]=t;break;
????????????????case 'L':t=d[4];d[4]=d[1];d[1]=d[3];d[3]=d[2];d[2]=t;break;
		}
	}
	printf("%d\n",d[0]);
}
int main(){
	int n;
	scanf("%d,&n");
	f(n);
	return 0;

}

Compiler output:
main.c: In function 'f':
main.c:4:6: error: type of 'n' defaults to 'int' [-Wimplicit-int]
    4 | void f(n){
      |      ^
main.c:13:1: error: expected expression before '?' token
   13 | ????????????????case 'W':d[2]=d[0];d[0]=d[1];d[1]=7-d[2];break;
      | ^
main.c:14:1: error: expected expression before '?' token
   14 | ????????????????case 'R':t=d[3];d[3]=d[1];d[1]=d[4];d[4]=d[2];d[2]=t;break;
      | ^
main.c:15:1: error: expected expression before '?' token
   15 | ????????????????case 'L':t=d[4];d[4]=d[1];d[1]=d[3];d[3]=d[2];d[2]=t;break;
      | ^
Language: C

#include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;
char s[99];
int main(){
	for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
}

Compiler output:
main.c: In function 'main':
main.c:5:45: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
      |                                             ^~~~
      |                                             fgets
main.c:5:134: error: lvalue required as left operand of assignment
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
      |                                                                                                                                      ^~
Language: C

#include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;
char s[99];
int main(){
s[87]=1,s[78]=4,s[69]=3,s[83]=2;
	for(
;gets(s);
*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
}

Compiler output:
main.c: In function 'main':
main.c:7:2: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 | ;gets(s);
      |  ^~~~
      |  fgets
main.c:8:82: error: lvalue required as left operand of assignment
    8 | *s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
      |                                                                                  ^~
Language: C

#include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;
char s[99];
int main(){
s[87]=1,s[78]=4,s[69]=3,s[83]=2;
	for(
;gets(s);
*s<60?printf(r?"%d\n":0,r),
a=c=0,b=r=1:
(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
}

Compiler output:
main.c: In function 'main':
main.c:7:2: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 | ;gets(s);
      |  ^~~~
      |  fgets
main.c:10:43: error: lvalue required as left operand of assignment
   10 | (d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
      |                                           ^~
Language: C

int N[]={ 6,10,18,14,  2,13,22,11,  3, 5,21,19,  1,17,23, 7,  0, 9,20,15,  4,12,16, 8};
int E[]={15, 7,11,19,  8, 3,14,23, 16, 0, 6,22,  4, 2,18,20, 12, 1,10,21,  9, 5,13,17};
int W[]={ 9,17,13, 5, 12,21,10, 1,  4,20,18, 2, 16,22, 6, 0,  8,23,14, 3, 15,19,11, 7};
int S[]={16,12, 4, 8, 20, 9, 0,15, 23,17, 1, 7, 21, 5, 3,19, 22,13, 2,11, 18,10, 6,14};
int R[]={ 1, 2, 3, 0,  5, 6, 7, 4,  9,10,11, 8, 13,14,15,12, 17,18,19,16, 21,22,23,20};
int L[]={ 3, 0, 1, 2,  7, 4, 5, 6, 11, 8, 9,10, 15,12,13,14, 19,16,17,18, 23,20,21,22};
n,a,d;
char s[9];
int main()
{
for(;;)
{
scanf("%d",&n);
if(!n)
break;
a=1;
d=0;
for(;n--;)
{
scanf("%s",s);
*s-78||d=N[d];
*s-69||d=E[d];
*s-87||d=W[d];
*s-83||d=S[d];
*s-82||d=R[d];
*s-76||d=L[d];
a+=d/4+1;
}
printf("%d\n",a);
}
}

Compiler output:
main.c:7:1: warning: data definition has no type or storage class
    7 | n,a,d;
      | ^
main.c:7:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:7:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    7 | n,a,d;
      |   ^
main.c:7:5: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
    7 | n,a,d;
      |     ^
main.c: In function 'main':
main.c:13:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 | scanf("%d",&n);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int N[]={ 6,10,18,14,  2,13,22,11,  3, 5,21,19,  1,17,23, 7,  0, 9,20,15,  4,12,16, 8};
main.c:13:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 | scanf("%d",&n);
      | ^~~~~
main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:21:9: error: lvalue required as left operand of assignment
   21 | *s-78||d=N[d];
      |         ^
main.c:22:9: error: lvalue required as left operand of assignment
   22 | *s-69||d=E[d];
      |         ^
main.c:23:9: error: lvalue required as left operand of assignment
   23 | *s-87||d=W[d];
      |         ^
main.c:24:9: error: lvalue required as left operand of assignment
   24 | *s-83||d=S[d];
      |         ^
main.c:25:9: error: lvalue required as left operand of assignment
   25 | *s-82||d=R[d];
      |         ^
main.c:26:9: error: lvalue required as left operand of assignment
   26 | *s-76||d=L[d];
      |         ^
main.c:29:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 | printf("%d\n",a);
      | ^~~~~~
main.c:29:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int N[]={ 6,10,18,14,  2,13,22,11,  3, 5,21,19,  1,17,23, 7,  0, 9,20,15,  4,12,16, 8};
int E[]={15, 7,11,19,  8, 3,14,23, 16, 0, 6,22,  4, 2,18,20, 12, 1,10,21,  9, 5,13,17};
int W[]={ 9,17,13, 5, 12,21,10, 1,  4,20,18, 2, 16,22, 6, 0,  8,23,14, 3, 15,19,11, 7};
int S[]={16,12, 4, 8, 20, 9, 0,15, 23,17, 1, 7, 21, 5, 3,19, 22,13, 2,11, 18,10, 6,14};
n,d,a;
char s[9];
main(c)
{
for(;gets(s);)
{
c=*s;
c<60&&a?printf("%d\n",a),a=0:0;
d=
(c-78?0:N[d])+
(c-69?0:E[d])+
(c-87?0:W[d])+
(c-83?0:S[d])+
(c-82?0:d&28|d%4+1&3)+
(c-76?0:d&28|d%4-1&3);
a+=d/4+1;
}
}

Compiler output:
main.c:5:1: warning: data definition has no type or storage class
    5 | n,d,a;
      | ^
main.c:5:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:5:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
    5 | n,d,a;
      |   ^
main.c:5:5: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    5 | n,d,a;
      |     ^
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
    7 | main(c)
      | ^~~~
main.c: In function 'main':
main.c:7:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:9:6: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    9 | for(;gets(s);)
      |      ^~~~
main.c:12:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 | c<60&&a?printf("%d\n",a),a=0:0;
      |         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int N[]={ 6,10,18,14,  2,13,22,11,  3, 5,21,19,  1,17,23, 7,  0, 9,20,15,  4,12,16, 8};
main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 | c<60&&a?printf("%d\n",a),a=0:0;
      |         ^~~~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");}

Compiler output:
main.c:1:8: error: expected ')' before 'char'
    1 | main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");}
      |        ^~~~
      |        )
Language: C

int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;

Compiler output:
main.c: In function 'main':
main.c:1:51: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
      |                                                   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
main.c:1:51: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
      |                                                   ^~~~~
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:119: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
      |                                                                                                                       ^~~~~~
main.c:1:119: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:119: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:119: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:1: error: expected declaration or statement at end of input
    1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
      | ^~~
Language: C

#include<stdio.h>

int main(){
  int north,east,west,south,cen,n,sum,b;
  char str[6];
  sum=1;
  scanf("%d",&n);
  north=5;
  cen=1;
  south=2;
  west=4;
  east=3;
  for(i=0;i<n;i++){
    scanf("%s",str);
    if(str[0]=='N'){
      north=cen;
      cen=south;
      south=7-north;
    }else if(str[0]=='E'){
      east=cen;
      cen=west;
      west=7-east;
    }else if(str[0]=='W'){
      west=cen;
      cen=east;
      east=7-west;
    }else if(str[0]=='S'){
      south=cen;
      cen=north;
      north=7-south;
    }else if(str[0]=='R'){
      b=south;
      south=east;
      east=north;
      north=west;
      west=b;
    }else{
      b=east;
      east=south;
      south=west;
      west=north;
      north=b;
    }
    sum+=cen;
  }
  printf("%d\n",sum);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:13:7: error: 'i' undeclared (first use in this function)
   13 |   for(i=0;i<n;i++){
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

int main(void){
	int top=1,bottom=6,east=3,west=4,south=2,north=5;
	int top_=1,bottom_=6,east_=4,west_=3,south_=2,north_=5;
	int n, sum=1;
	char act[256];
	
	while(1){
		scanf("%d",&n);
		if(n!=0){
			while(n>=0){
				gets(act);
				
				if(!strcmp(act,"North")){
					top = south;
					bottom = north;
					south = bottom_;
					north = top_;
					bottom_ = bottom;
					top_ = top;
					sum += top;
				}else if(!strcmp(act,"South")){
					top = north;
					bottom = south;
					south = top_;
					north = bottom_;
					top_ = top;
					bottom_ = bottom;
					sum += top;
				}else if(!strcmp(act,"West")){
					top = east;
					bottom = west;
					west = top_;
					east = bottom_;
					top_ = top;
					bottom = bottom_;
					sum += top;
				}else if(!strcmp(act,"East")){
					top = west;
					bottom = east;
					west = bottom_;
					east = top_;
					top_ = top;
					bottom = bottom;
					sum += top;
				}else if(!strcmp(act,"Right")){
					west = north;
					east = south;
					south = west_;
					north = east_;
					west_ = west;
					east_ = east;
					sum += top;
				}else if(!strcmp(act,"Left")){
					west = south;
					east = north;
					south = east_;
					north = west_;
					west_ = west;
					east_ = east;
					sum += top;
				}
				n--;
			}
				
		printf("%d\n",sum);
		sum = 1;
		
		}else{
			break;
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:33: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   14 |                                 gets(act);
      |                                 ^~~~
      |                                 fgets
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(void){
	int top=1,bottom=6,east=3,west=4,south=2,north=5;
	int top_=1,bottom_=6,east_=4,west_=3,south_=2,north_=5;
	int n, sum=1;
	char act[256];
	
	while(1){
		scanf("%d",&n);
		if(n!=0){
			while(n>=0){
				gets(act);
				
				if(!strcmp(act,"North")){
					top = south;
					bottom = north;
					south = bottom_;
					north = top_;
					bottom_ = bottom;
					top_ = top;
					sum += top;
				}else if(!strcmp(act,"South")){
					top = north;
					bottom = south;
					south = top_;
					north = bottom_;
					top_ = top;
					bottom_ = bottom;
					sum += top;
				}else if(!strcmp(act,"West")){
					top = east;
					bottom = west;
					west = top_;
					east = bottom_;
					top_ = top;
					bottom = bottom_;
					sum += top;
				}else if(!strcmp(act,"East")){
					top = west;
					bottom = east;
					west = bottom_;
					east = top_;
					top_ = top;
					bottom = bottom;
					sum += top;
				}else if(!strcmp(act,"Right")){
					west = north;
					east = south;
					south = west_;
					north = east_;
					west_ = west;
					east_ = east;
					sum += top;
				}else if(!strcmp(act,"Left")){
					west = south;
					east = north;
					south = east_;
					north = west_;
					west_ = west;
					east_ = east;
					sum += top;
				}
				n--;
			}
				
		printf("%d\n",sum);
		sum = 1;
		
		}else{
			break;
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:33: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   15 |                                 gets(act);
      |                                 ^~~~
      |                                 fgets
Language: C

#include <stdio.h>

typedef struct {
	int up;
	int left;
	int right;
	int front;
	int back;
	int down;
} dice_t;

void init(dice_t* dice) {
	dice->up=1;
	dice->left=4;
	dice->right=3;
	dice->front=2;
	dice->back=5;
	dice->down=6;
}

void North(dice_t* dice) {
	int temp;
	temp=dice->up;
	dice->up=dice->front;
	dice->front=dice->down;
	dice->down=dice->back;
	dice->back=temp;
}

void East(dice_t* dice) {
	int temp;
	temp=dice->up;
	dice->up=dice->left;
	dice->left=dice->down;
	dice->down=dice->right;
	dice->right=temp;
}

void West(dice_t* dice) {
	int temp;
	temp=dice->up;
	dice->up=dice->right;
	dice->right=dice->down;
	dice->down=dice->left;
	dice->left=temp;
}

void South(dice_t* dice) {
	int temp;
	temp=dice->up;
	dice->up=dice->back;
	dice->back=dice->down;
	dice->down=dice->front;
	dice->front=temp;
}

void Right(dice_t* dice) {
	int temp;
	temp=dice->front;
	dice->front=dice->right;
	dice->right=dice->back;
	dice->back=dice->left;
	dice->left=temp;
}

void Left(dice_t* dice) {
	int temp;
	temp=dice->front;
	dice->front=dice->left;
	dice->left=dice->back;
	dice->back=dice->right;
	dice->right=temp;
}

int main(void) {
	char sizi[10];
	int i,n;
	int sum;
	dice_t dice;
	while(1) {
		scanf("%d",&n);
		if(n==0)break;
		init(&dice);
		sum=1;
		for(i=0;i<n;i++) {
			scanf("%s",sizi);
			switch(size[0]) {
				case 'N':
					North(&dice);
					break;
				case 'E':
					East(&dice);
					break;
				case 'W':
					West(&dice);
					break;
				case 'S':
					South(&dice);
					break;
				case 'R':
					Right(&dice);
					break;
				case 'L':
					Left(&dice);
					break;
			}
			sum+=dice.up;
		}
		printf("%d\n",sum);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:87:32: error: 'size' undeclared (first use in this function); did you mean 'sizi'?
   87 |                         switch(size[0]) {
      |                                ^~~~
      |                                sizi
main.c:87:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <string.h>

void no(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=*y;
	*y=7-n;
	*s+=*x;
}
void ea(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=7-*z;
	*z=n;
	*s+=*x;
	return;
}
void we(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=*z;
	*z=7-n;
	*s+=*x;
	return;
}
void so(int *x,int *y,int *z,int *s){
	int n=*y;
	*y=*x;
	*x=7-n;
	*s+=*x;
	return;
}
void ri(int *x,int *y,int *z,int *s){
	int n=*y;
	*y=*z;
	*z=7-n;
	*s+=*x;
	return;
}
void le(int *x,int *y,int *z,int *s){
	int n=*z;
	*z=*y;
	*y=7-n;
	*z=n;
	*s+=*x;
	return;
}

int main(){
	int n,i,j=0,sum,a1,a2,a3,num[1000];
	sum=1;a1=1;a2=2;a3=3;
	char c[6];
	for(;;j++){
		scanf("%d",&n);
		if(n==0) break;	
		while(n>0){
			A:
			scanf("%s",c);
			if(strcmp(c,"North")==0){
				no(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"East")==0){
				ea(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"West")==0){
				we(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"South")==0){
				so(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"Right")==0){
				ri(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"Left")==0){
				le(&a1,&a2,&a3,&sum);
			}else{
				printf("error!");
				goto A;
			}			
			n--;
		}
		num[j]=sum;
		sum=1;a1=1;a2=2;a3=3;
		c[0]='\0';
	}
	for(i=0;i<j;i++){
		printf("%d\n",num[i]);
	}
　　　　　return 0;
}

Compiler output:
main.c: In function 'main':
main.c:82:1: error: stray '\343' in program
   82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      | ^~~~~~~~
main.c:82:3: error: stray '\343' in program
   82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |         ^~~~~~~~
main.c:82:5: error: stray '\343' in program
   82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                 ^~~~~~~~
main.c:82:7: error: stray '\343' in program
   82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                         ^~~~~~~~
main.c:82:9: error: stray '\343' in program
   82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                                 ^~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void no(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=*y;
	*y=7-n;
	*s+=*x;
}
void ea(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=7-*z;
	*z=n;
	*s+=*x;
	return;
}
void we(int *x,int *y,int *z,int *s){
	int n=*x;
	*x=*z;
	*z=7-n;
	*s+=*x;
	return;
}
void so(int *x,int *y,int *z,int *s){
	int n=*y;
	*y=*x;
	*x=7-n;
	*s+=*x;
	return;
}
void ri(int *x,int *y,int *z,int *s){
	int n=*y;
	*y=*z;
	*z=7-n;
	*s+=*x;
	return;
}
void le(int *x,int *y,int *z,int *s){
	int n=*z;
	*z=*y;
	*y=7-n;
	*z=n;
	*s+=*x;
	return;
}

int main(){
	int n,i,j=0,sum,a1,a2,a3,num[1000];
	sum=1;a1=1;a2=2;a3=3;
	char c[6];
	for(;;j++){
		scanf("%d",&n);
		if(n==0) break;	
		while(n>0){
			A:
			scanf("%s",c);
			if(strcmp(c,"North")==0){
				no(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"East")==0){
				ea(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"West")==0){
				we(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"South")==0){
				so(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"Right")==0){
				ri(&a1,&a2,&a3,&sum);
			}else if(strcmp(c,"Left")==0){
				le(&a1,&a2,&a3,&sum);
			}else{
				printf("error!");
				goto A;
			}			
			n--;
		}
		num[j]=sum;
		sum=1;a1=1;a2=2;a3=3;
		c[0]='\0';
	}
	for(i=0;i<j;i++){
		printf("%d\n",num[i]);
	}
　　　　　return 0;
}

Compiler output:
main.c: In function 'main':
main.c:83:1: error: stray '\343' in program
   83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      | ^~~~~~~~
main.c:83:3: error: stray '\343' in program
   83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |         ^~~~~~~~
main.c:83:5: error: stray '\343' in program
   83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                 ^~~~~~~~
main.c:83:7: error: stray '\343' in program
   83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                         ^~~~~~~~
main.c:83:9: error: stray '\343' in program
   83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                                 ^~~~~~~~
Language: C

	scanf("%d",&n);
	if(n==0)break;
	for(i=0;i<n;i++){
		sum +=saikoro1;

		scanf("%s",mozi);
		if(strcmp("North",mozi)==0){
			me = 7 - saikoro1;
			saikoro1 = saikoro2;
			saikoro2 = me;
		}
		if(strcmp("East",mozi)==0){
			me = 7-saikoro3;
			saikoro3 = saikoro1;
			saikoro1 = me;
		}
		if(strcmp("West",mozi)==0){
			me = 7-saikoro1;
			saikoro1 = saikoro3;
			saikoro3 = me;
		}
		if(strcmp("South",mozi)==0){
			me = 7-saikoro2;
			saikoro2 = saikoro1;
			saikoro1 = me;
		}
		if(strcmp("Right",mozi)==0){
			me = 7-saikoro2;
			saikoro2 = saikoro3;
			saikoro3 = me;
		}
		if(strcmp("Left",mozi)==0){
			me = 7 - saikoro3;
			saikoro3 = saikoro2;
			saikoro2 = me;
		}
		
	}
	printf("%d\n",sum);
}
return 0;
}

Compiler output:
main.c:1:15: error: expected declaration specifiers or '...' before string constant
    1 |         scanf("%d",&n);
      |               ^~~~
main.c:1:20: error: expected declaration specifiers or '...' before '&' token
    1 |         scanf("%d",&n);
      |                    ^
main.c:2:9: error: expected identifier or '(' before 'if'
    2 |         if(n==0)break;
      |         ^~
main.c:3:9: error: expected identifier or '(' before 'for'
    3 |         for(i=0;i<n;i++){
      |         ^~~
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |         for(i=0;i<n;i++){
      |                  ^
main.c:3:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |         for(i=0;i<n;i++){
      |                      ^~
main.c:39:16: error: expected declaration specifiers or '...' before string constant
   39 |         printf("%d\n",sum);
      |                ^~~~~~
main.c:39:23: error: unknown type name 'sum'
   39 |         printf("%d\n",sum);
      |                       ^~~
main.c:40:1: error: expected identifier or '(' before '}' token
   40 | }
      | ^
main.c:41:1: error: expected identifier or '(' before 'return'
   41 | return 0;
      | ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

#include <stdio.h>
#include <string.h>

enum {
	UP,
	FRONT,
	RIGHT,
	DOWN,
	BACK,
	LEFT,
};

int _tmain(int argc, _TCHAR* argv[])
{
	int dice[6] = {1, 2, 3, 6, 5, 4};
	int cnt = 0,
		times, 
		sum = dice[UP];

	printf("回数 => ");
	scanf("%d", &times);

	do{
		char input[20] = "";
		printf("命令 => ");
		scanf("%s", input);

		int keep;

		if(strcmp(input, "North") == 0){
			keep = dice[UP];
			dice[UP] = dice[FRONT];
			dice[FRONT] = dice[DOWN];
			dice[DOWN] = dice[BACK];
			dice[BACK] = keep;

			sum += dice[UP];
			cnt++;
		}

		else if(strcmp(input, "East") == 0){
			keep = dice[UP];
			dice[UP] = dice[LEFT];
			dice[LEFT] = dice[DOWN];
			dice[DOWN] = dice[RIGHT];
			dice[RIGHT] = keep;

			sum += dice[UP];
			cnt++;
		}

		else if(strcmp(input, "West") == 0){
			keep = dice[UP];
			dice[UP] = dice[RIGHT];
			dice[RIGHT] = dice[DOWN];
			dice[DOWN] = dice[LEFT];
			dice[LEFT] = dice[UP];

			sum += dice[UP];
			cnt++;
		}

		else if(strcmp(input, "South") == 0){
			keep = dice[UP];
			dice[UP] = dice[BACK];
			dice[BACK] = dice[DOWN];
			dice[DOWN] = dice[FRONT];
			dice[FRONT] = dice[UP];

			sum += dice[UP];
			cnt++;
		}

		else if(strcmp(input, "Right") == 0){
			keep = dice[FRONT];
			dice[FRONT] = dice[RIGHT];
			dice[RIGHT] = dice[BACK];
			dice[BACK] = dice[LEFT];
			dice[LEFT] = keep;

			sum += dice[UP];
			cnt++;
		}

		else if(strcmp(input, "Left") == 0){
			keep = dice[FRONT];
			dice[FRONT] = dice[LEFT];
			dice[LEFT] = dice[BACK];
			dice[BACK] = dice[RIGHT];
			dice[RIGHT] = keep;

			sum += dice[UP];
			cnt++;
		}

		else{
			printf("入力ミスがあります。もう一度入力してください。\n");
			continue;
		}
	}while(cnt != times);

	printf("合計 => %d\n", sum);
	return 0;
}

Compiler output:
main.c:13:22: error: unknown type name '_TCHAR'
   13 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++


#include <iostream>

using namespace std;
 
int main(){
  string h;
  int a;
 
  while(cin >> a,a){
    int sum = 1,top = 1,dice[4] = {2,3,4,5};
    for(int i = 0 ; i < a ; i++){
      cin >> h;
      int tmp = top;
      if( i == 0 ) top = 1;
      if(h == "North"){
	top = dice[0];
	dice[0] = 7 - tmp;
	dice[3] = tmp;
      }
      else if(h == "East"){
	top = dice[2];
	dice[2] = 7 - tmp;
	dice[1] = tmp;
      }
      else if(h == "West"){
	top = dice[1];
	dice[1] = 7 - tmp;
	dice[2] = tmp; 
      }
      else if(h == "South"){
	top = dice[3];
	dice[3] = 7 - tmp;
	dice[0] = tmp;
      }
      else if(h == "Right"){
	tmp = dice[3];
	dice[3] = dice[2];
	dice[2] = dice[0];
	dice[0] = dice[1];
	dice[1] = tmp;
      }
      else{
	tmp = dice[3];
	dice[3] = dice[1];
	dice[1] = dice[0];
	dice[0] = dice[2];
	dice[2] = tmp; 
      }
      sum += top;
    }
    cout << sum << endl;
  }
 
  return 0;
}



Compile Error Logs: 

 

Status 
Judge: 1/1 C++ CPU: 00:00 sec Memory: 1208 KB Length: 905 B 2014-07-11 12:39 
Results for testcases 
Case # Verdict CPU Time Memory In Out Case Name 

Case #1 : Accepted 00:00 1208 28563 20 judge_data 



 < prev |  /   | next >      

 

Judge Input #  (  | )  Judge Output #  (  | ) 


  

 



Compiler output:
a.cc:67:6: error: stray '#' in program
   67 | Case # Verdict CPU Time Memory In Out Case Name
      |      ^
a.cc:69:6: error: stray '#' in program
   69 | Case #1 : Accepted 00:00 1208 28563 20 judge_data
      |      ^
a.cc:77:13: error: stray '#' in program
   77 | Judge Input #  (  | )  Judge Output #  (  | )
      |             ^
a.cc:77:37: error: stray '#' in program
   77 | Judge Input #  (  | )  Judge Output #  (  | )
      |                                     ^
a.cc:60:1: error: 'Compile' does not name a type
   60 | Compile Error Logs:
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	int a[3]={1,2,3};
	int n,i,temp,out;
	char b[6];
	while(cin>>n){
		if(n==0){break;}
		a[3]={1,2,3};
		out=1;
		for(i=0;i<n;i++){
			cin>>b;
			if(b[0]=='N'){
				temp=a[0];
				a[0]=a[1];
				a[1]=7-temp;
				out+=a[0];
			}else if(b[0]=='E'){
				temp=a[2];
				a[2]=a[0];
				a[0]=7-temp;
				out+=a[0];
			}else if(b[0]=='W'){
				temp=a[0];
				a[0]=a[2];
				a[2]=7-temp;
				out+=a[0];
			}else if(b[0]=='S'){
				temp=a[1];
				a[1]=a[0];
				a[0]=7-temp;
				out+=a[0];
			}else if(b[0]=='R'){
				temp=a[1];
				a[1]=a[2];
				a[2]=7-temp;
				out+=a[0];
			}else if(b[0]=='L'){
				temp=a[2];
				a[2]=a[1];
				a[1]=7-temp;
				out+=a[0];
			}
		}
		cout<<out<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
    9 |                 a[3]={1,2,3};
      |                            ^
Language: C++

#include<cstdio>
#include<string>
#include<iostream>
using namespace std;

int main(){
	while (1){
		int u = 1, d = 6, e = 3, w = 4, n = 5, s = 2;
		int ans = 1;
		int N;
		scanf_s("%d", &N);
		if (N == 0)return 0;
		for (int i = 0; i < N; i++){
			string dir;
			cin >> dir;
			int a;
			if (dir == "North"){
				a = u;
				u = s, s = d, d = n;
				n = a;
			}
			if (dir == "East"){
				a = u, u = w, w = d, d = e, e = a;
			}
			if (dir == "Right"){
				a = s, s = e, e = n, n = w, w = a;
			}
			if (dir == "Left"){
				a = s, s = w, w = n, n = e, e = a;
			}
			if (dir == "West"){
				a = u, u = e, e = d, d = w, w = a;
			}
			if (dir == "South"){
				a = u, u = n, n = d, d = s, s = a;
			}
			ans += u;
		}
		printf("%d\n", ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |                 scanf_s("%d", &N);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include "stdafx.h"
#include <iostream>
#include <string>
#include <utility>
using namespace std;
void rotate(int& a,int& b,int& c,int& d){
	swap(a,b);
	swap(a,d);
	swap(c,d);
}
int main()
{
	int n,sum=1,num[6]={1,2,3,4,5,6};
	string s;
	cin>>n;
	while(n--){
		cin>>s;
		if(s=="North")rotate(num[5],num[1],num[0],num[4]);
		else if(s=="South")rotate(num[4],num[0],num[1],num[5]);
		else if(s=="West")rotate(num[5],num[2],num[0],num[3]);
		else if(s=="East")rotate(num[3],num[0],num[2],num[5]);
		else if(s=="Right")rotate(num[1],num[3],num[4],num[2]);
		else if(s=="Left")rotate(num[2],num[4],num[3],num[1]);
		sum+=num[0];
	}
	cout<<sum<<endl;
    return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <utility>
using namespace std;
void rotate(int& a,int& b,int& c,int& d){
	swap(a,b);
	swap(a,d);
	swap(c,d);
}
int main()
{
	while(ture){
		int n,sum=1,num[6]={1,2,3,4,5,6};
		string s;
		cin>>n;
		if(!n)break;
		while(n--){
			cin>>s;
			if(s=="North")rotate(num[5],num[1],num[0],num[4]);
			else if(s=="South")rotate(num[4],num[0],num[1],num[5]);
			else if(s=="West")rotate(num[5],num[2],num[0],num[3]);
			else if(s=="East")rotate(num[3],num[0],num[2],num[5]);
			else if(s=="Right")rotate(num[1],num[3],num[4],num[2]);
			else if(s=="Left")rotate(num[2],num[4],num[3],num[1]);
			sum+=num[0];
		}
		cout<<sum<<endl;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'ture' was not declared in this scope
   12 |         while(ture){
      |               ^~~~
Language: C++

#include<iostream>
using namespace std;
struct dice{
	int court[6];
	dice(int c[6]){court[0]=c[0];court[1]=c[1];court[2]=c[2];court[3]=c[3];court[4]=c[4];court[5]=c[5];}
	dice(){}
	void roll(char *ch);
	int top(){return court[0];}
};

void dice::roll(char *ch){
	int tmp;
	if(!strcmp("North", ch)){
		tmp = court[0];
		court[0] = court[1];
		court[1] = court[5];
		court[5] = court[4];
		court[4] = tmp;
	}
	if(!strcmp("East", ch)){
		tmp = court[0];
		court[0] = court[3];
		court[3] = court[5];
		court[5] = court[2];
		court[2] = tmp;
	}
	if(!strcmp("West", ch)){
		tmp = court[0];
		court[0] = court[2];
		court[2] = court[5];
		court[5] = court[3];
		court[3] = tmp;
	}
	if(!strcmp("South", ch)){
		tmp = court[0];
		court[0] = court[4];
		court[4] = court[5];
		court[5] = court[1];
		court[1] = tmp;
	}
	if(!strcmp("Right", ch)){
		tmp = court[1];
		court[1] = court[2];
		court[2] = court[4];
		court[4] = court[3];
		court[3] = tmp;
	}
	if(!strcmp("Left", ch)){
		tmp = court[1];
		court[1] = court[3];
		court[3] = court[4];
		court[4] = court[2];
		court[2] = tmp;
		}
	return;
}

int main(){
	int n, sum;
	int a[6] = {1,2,3,4,5,6};
	char ch[10];
	while(true){
		cin >> n;
		dice d(a);
		sum=d.top();
		if(n==0)break;
		for(int i=0;i<n;i++){
			cin>>ch;
			d.roll(ch);
			sum += d.top();
		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc: In member function 'void dice::roll(char*)':
a.cc:13:13: error: 'strcmp' was not declared in this scope
   13 |         if(!strcmp("North", ch)){
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:20:13: error: 'strcmp' was not declared in this scope
   20 |         if(!strcmp("East", ch)){
      |             ^~~~~~
a.cc:20:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:27:13: error: 'strcmp' was not declared in this scope
   27 |         if(!strcmp("West", ch)){
      |             ^~~~~~
a.cc:27:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:34:13: error: 'strcmp' was not declared in this scope
   34 |         if(!strcmp("South", ch)){
      |             ^~~~~~
a.cc:34:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:41:13: error: 'strcmp' was not declared in this scope
   41 |         if(!strcmp("Right", ch)){
      |             ^~~~~~
a.cc:41:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:48:13: error: 'strcmp' was not declared in this scope
   48 |         if(!strcmp("Left", ch)){
      |             ^~~~~~
a.cc:48:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

import java.io.*; // namespace...

class aoj0502 {
	
	public static void main() {
		
		System.out.printf("%d%n", solve());
		return;
	} 
	
	private int solve() {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int ret = 1;
		String buf;
		
		int dtop=1, dforward=2, dside=3;
		
		
		while((buf = br.readLine()) != null) {
			int tmp;
			switch(buf) {
			case "North":
				tmp = dtop;
				dtop = dforward;
				dforward = 7-tmp;
				break;
			case "South":
				tmp = dtop;
				dtop = 7-dforward;
				dforward = tmp;
				break;
			case "West":
				tmp = dtop;
				dtop = dside;
				dside = 7-tmp;
				break;
			case "East":
				tmp = dtop;
				dtop = 7-dside;
				dside = tmp;
				break;
			case "Right":
				tmp = dforward;
				dforward = dside;
				dside = 7-tmp;
				break;
			case "Left":
				tmp = dforward;
				dforward = 7-dside;
				dside = tmp;
			}
			ret += dtop;
		}
		return ret;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*; // namespace...
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main() {
      |               ^~~~~~~
      |               :
a.cc:11:16: error: expected ':' before 'int'
   11 |         private int solve() {
      |                ^~~~
      |                :
a.cc:58:2: error: expected ';' after class definition
   58 | }
      |  ^
      |  ;
a.cc: In static member function 'static void aoj0502::main()':
a.cc:7:17: error: 'System' was not declared in this scope
    7 |                 System.out.printf("%d%n", solve());
      |                 ^~~~~~
a.cc:7:48: error: cannot call member function 'int aoj0502::solve()' without object
    7 |                 System.out.printf("%d%n", solve());
      |                                           ~~~~~^~
a.cc: In member function 'int aoj0502::solve()':
a.cc:12:17: error: 'InputStreamReader' was not declared in this scope
   12 |                 InputStreamReader isr = new InputStreamReader(System.in);
      |                 ^~~~~~~~~~~~~~~~~
a.cc:13:17: error: 'BufferedReader' was not declared in this scope
   13 |                 BufferedReader br = new BufferedReader(isr);
      |                 ^~~~~~~~~~~~~~
a.cc:16:17: error: 'String' was not declared in this scope
   16 |                 String buf;
      |                 ^~~~~~
a.cc:21:24: error: 'buf' was not declared in this scope
   21 |                 while((buf = br.readLine()) != null) {
      |                        ^~~
a.cc:21:30: error: 'br' was not declared in this scope
   21 |                 while((buf = br.readLine()) != null) {
      |                              ^~
a.cc:21:48: error: 'null' was not declared in this scope
   21 |                 while((buf = br.readLine()) != null) {
      |                                                ^~~~
Language: C++

#include<iostream>
#include <string>
#include <utility>
using namespace std;

int main(){
while(1){
int n = 0;
cin >> n;
if(n == 0){break;}
int sum = 1;
int a[7];
for(int i = 0;i <= 6;i++){
a[i] = i + 1;
}
for (int i = 1;i <= n;i++){
string c;string N = "North";string E = "East";string S  = "South";string W = "West";
string R = "Right";string L = "Left";
cin >> c;
if(c == N){
a[6] = a[0];a[0] = a[1];a[1] = a[5];a[5] = a[4];a[4] = a[6];
}
if(c == S){
a[6] = a[0];a[0] = a[4];a[4] = a[5];a[5] = a[1];a[1] = a[6];
}
if(c == E){
a[6] = a[0];a[0] = a[3];a[3] = a[5];a[5] = a[2];a[2] = a[6];
}
if(c == W){
a[6] = a[0];a[0] = a[2];a[2] = a[5];a[5] = a[3];a[3] = a[6];
}
if(c == R){
a[6] = a[1];a[1] = a[2];a[2] = a[4];a[4] = a[3];a[3] = a[6];
}
if(c == L{
a[6] = a[1];a[1] = a[3];a[3] = a[4];a[4] =a[2];a[2] = a[6];
}
sum = sum + a[0];
}
cout << sum << endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:10: error: expected ';' before '{' token
   35 | if(c == L{
      |          ^
      |          ;
a.cc:35:6: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   35 | if(c == L{
      |    ~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3755:5: note: declared here
 3755 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:38:17: error: expected ')' before ';' token
   38 | sum = sum + a[0];
      |                 ^
      |                 )
a.cc:35:3: note: to match this '('
   35 | if(c == L{
      |   ^
Language: C++

# -*- coding:shift-jis -*-
 
class Dice:
 
    def __init__(self):
        self.top = 1
        self.south = 2
        self.north = 5
        self.east = 3
        self.west = 4
        self.bottom = 6
 
    def rotate(self,operation):
        if operation == "North":
            self.top,self.north,self.bottom,self.south = self.south,self.top,self.north,self.bottom
        elif operation == "East":
            self.top,self.east,self.bottom,self.west = self.west,self.top,self.east,self.bottom
        elif operation == "West":
            self.top,self.east,self.bottom,self.west = self.east,self.bottom,self.west,self.top
        elif operation == "South":
            self.top,self.north,self.bottom,self.south = self.north,self.bottom,self.south,self.top
        elif operation == "Right":
            self.north,self.east,self.south,self.west = self.west,self.north,self.east,self.south
        elif operation == "Left":
            self.north,self.east,self.south,self.west = self.east,self.south,self.west,self.north,
 
n = int(input())
 
while n!=0:
    value = 1
    d = Dice()
    for i in [input() for _ in range(n)]:
        d.rotate(i)
        value += d.top
    print(value)
    n = int(input())

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding:shift-jis -*-
      |   ^
a.cc:5:9: error: expected class-name before '__init__'
    5 |     def __init__(self):
      |         ^~~~~~~~
a.cc:5:9: error: expected '{' before '__init__'
a.cc:5:18: error: 'self' was not declared in this scope
    5 |     def __init__(self):
      |                  ^~~~
Language: C++

# -*- coding:shift-jis -*-
 
class Dice:
 
    def __init__(self):
        self.top = 1
        self.south = 2
        self.north = 5
        self.east = 3
        self.west = 4
        self.bottom = 6
 
    def rotate(self,operation):
        if operation == "North":
            self.top,self.north,self.bottom,self.south = self.south,self.top,self.north,self.bottom
        elif operation == "East":
            self.top,self.east,self.bottom,self.west = self.west,self.top,self.east,self.bottom
        elif operation == "West":
            self.top,self.east,self.bottom,self.west = self.east,self.bottom,self.west,self.top
        elif operation == "South":
            self.top,self.north,self.bottom,self.south = self.north,self.bottom,self.south,self.top
        elif operation == "Right":
            self.north,self.east,self.south,self.west = self.west,self.north,self.east,self.south
        elif operation == "Left":
            self.north,self.east,self.south,self.west = self.east,self.south,self.west,self.north,
 
n = int(input())
 
while n!=0:
    value = 1
    d = Dice()
    for i in range(n):
        d.rotate(input())
        value += d.top
    print(value)
    n = int(input())

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding:shift-jis -*-
      |   ^
a.cc:5:9: error: expected class-name before '__init__'
    5 |     def __init__(self):
      |         ^~~~~~~~
a.cc:5:9: error: expected '{' before '__init__'
a.cc:5:18: error: 'self' was not declared in this scope
    5 |     def __init__(self):
      |                  ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main(void){
	int n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1;
	char muki[10];
	
	while (1){
		scanf_s("%d", &n);
		b = 1, z1 = 2, z2 = 3, g = 1;
		for (int i = 0; i < n; i++){
			scanf_s("%s", muki, 10);
			if (strcmp(muki, "North") == 0){
				n1 = z1;
				z1 = 7 - b;
				b = n1;
			}
			if (strcmp(muki, "East") == 0){
				n1 = 7 - z2;
				z2 = b;
				b = n1;
			}
			if (strcmp(muki, "West") == 0){
				n1 = z2;
				z2 = 7 - b;
				b = n1;
			}
			if (strcmp(muki, "South") == 0){
				n1 = 7 - z1;
				z1 = b;
				b = n1;
			}
			if (strcmp(muki, "Right") == 0){
				n2 = 7 - z1;
				z1 = z2;
				z2 = n2;
			}
			if (strcmp(muki, "Left") == 0){
				n2 = z1;
				z1 = 7 - z2;
				z2 = n2;
			}
			g += b;
		}
		if (n == 0){
			break;
		}
		printf("%d", g);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf