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

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

main(){


    int n,i,sum;
    string say;
    int on,under,right,left,forward,back;
    int preon,preunder,preright,preleft,preforward,preback;

    on = 1, back = 2, right = 3, left = 4, forward = 5, under = 6;

    while(1){
        sum = 0;

        scanf("%d",\n);
        
        for(i=0,i<n,i++){

            preon = on, preunder = under, preleft = left, preringht = right, preforward = forward, preback = back;

            scanf("%s",\say);

            switch(say){

                case "North"
                    forward = preon, under = preforward, back = preunder, on = preback;

                case "South"
                    forward = preunder, 

            }

        }

    }

    return 0;

}

Compiler output:
a.cc:17:20: error: stray '\' in program
   17 |         scanf("%d",\n);
      |                    ^
a.cc:23:24: error: stray '\' in program
   23 |             scanf("%s",\say);
      |                        ^
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope; did you mean 'stdin'?
    8 |     string say;
      |     ^~~~~~
      |     stdin
a.cc:19:24: error: expected ';' before ')' token
   19 |         for(i=0,i<n,i++){
      |                        ^
      |                        ;
a.cc:37:5: error: expected primary-expression before '}' token
   37 |     }
      |     ^
a.cc:35:10: error: expected ';' before '}' token
   35 |         }
      |          ^
      |          ;
   36 | 
   37 |     }
      |     ~     
a.cc:37:5: error: expected primary-expression before '}' token
   37 |     }
      |     ^
a.cc:35:10: error: expected ')' before '}' token
   35 |         }
      |          ^
      |          )
   36 | 
   37 |     }
      |     ~     
a.cc:19:12: note: to match this '('
   19 |         for(i=0,i<n,i++){
      |            ^
a.cc:37:5: error: expected primary-expression before '}' token
   37 |     }
      |     ^
Language: C++

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

int main(){
    int n;
    string operation;
    int sum;
    int current_num;
    while(cin >> n){
        if(n==0)return 0;
        sum = 1;
        current_num = 1;
        int deme[] = {2,5,4,3};
        for(int i = 0; i < n; i++){
           cin >> operation;
           if (operation[0] == "North"){
                int d = deme[0];
                sum += deme[0];
                deme[0] = 7 - current_num;
                deme[1] = current_num;
                current_num = d;
           }
           else if (operation[0] == "South"){

                int d  = deme[1];
                sum += deme[1];
                deme[0] = current_num;
                deme[1] = 7 - current_num;
                current_num = d;
           }
           else if (operation[0] == "East"){
                int d = deme[2];
                sum += deme[2];
                deme[2] = 7 - current_num;
                deme[3] = current_num;
                current_num = d;
           }
           else if (operation[0] == "West"){
                int d = deme[3];
                sum += deme[3];
                deme[2] = current_num;
                deme[3] = 7 - current_num;
                current_num = d;
           }
           else if (operation[0] == "Right"){
                int swap_n = deme[0];
                int swap_s = deme[1];
                deme[0] = deme[3];
                deme[1] = deme[2];
                deme[2] = swap_n;
                deme[3] = swap_s;
                sum += current_num;
           }
           else if (operation[0] == "Left"){
                int swap_n = deme[0];
                int swap_s = deme[1];
                deme[0] = deme[2];
                deme[1] = deme[3];
                deme[2] = swap_s;
                deme[3] = swap_n;
                sum += current_num;
            }
        }
        cout << sum << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |            if (operation[0] == "North"){
a.cc:24:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |            else if (operation[0] == "South"){
a.cc:32:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |            else if (operation[0] == "East"){
a.cc:39:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |            else if (operation[0] == "West"){
a.cc:46:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   46 |            else if (operation[0] == "Right"){
a.cc:55:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   55 |            else if (operation[0] == "Left"){
Language: C++

#include<iostream>
using namespace std;
int main(){
	int i,m;
	char Dice[6];
	int sum;
	int num[6],s[6];
	while(1){
		sum=1;
		for(i=0;i<6;i++){
			s[i]=i+1;
		}
		cin>>n;
		for(m=0;m<n;m++){
			cin>>Dice;
			if(Dice[0]=='N'){
				num[0]=s[1];
				num[1]=s[5];
				num[4]=s[0];
				num[5]=s[4];
				s[0]=num[0];
				s[1]=num[1];
				s[4]=num[4];
				s[5]=num[5];
			}
			else if(Dice[0]=='E'){
				num[0]=s[3];
				num[2]=s[0];
				num[3]=s[5];
				num[5]=s[2];
				s[0]=num[0];
				s[2]=num[2];
				s[3]=num[3];
				s[5]=num[5];
			}
			else if(Dice[0]=='W'){
				num[0]=s[2];
				num[2]=s[5];
				num[3]=s[0];
				num[5]=s[3];
				s[0]=num[0];
				s[2]=num[2];
				s[3]=num[3];
				s[5]=num[5];
			}
			else if(Dice[0]=='S'){
				num[0]=s[4];
				num[1]=s[0];
				num[4]=s[5];
				num[5]=s[1];
				s[0]=num[0];
				s[1]=num[1];
				s[4]=num[4];
				s[5]=num[5];
			}
			else if(Dice[0]=='R'){
				num[1]=s[2];
				num[2]=s[4];
				num[3]=s[1];
				num[4]=s[3];
				s[1]=num[1];
				s[2]=num[2];
				s[3]=num[3];
				s[4]=num[4];
			}
			else if(Dice[0]=='L'){
				num[1]=s[3];
				num[2]=s[1];
				num[3]=s[4];
				num[4]=s[2];
				s[1]=num[1];
				s[2]=num[2];
				s[3]=num[3];
				s[4]=num[4];
			}
			sum=sum+num[0];
		}
		cout<<sum<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: 'n' was not declared in this scope
   13 |                 cin>>n;
      |                      ^
Language: C++

#include<stdio.h>
int main()
{
    int i, j, w, h, n, l, m, cnt = 1;
    char str1[100] = { 0 };
    int a[100];
    int b[6 + 100];
    int box[6 + 100];
    int temp;
    scanf("%d", &n);
    for (i = 1; i <= n; i++) {
        scanf("%s", str1[i]);
    }
    for (i = 1; i <= 6; i++) {
        box[i] = cnt;
        a[i] = cnt;
        cnt++;
    }
    for (i = 0; i < n; i++) {
        if (str1== "North") {
            temp += a[1];
            box[1] = a[1];
            box[2] = a[2];
            box[5] = a[5];
            box[6] = a[6];
            a[2] = box[1];
            a[6] = box[2];
            a[5] = box[6];
            a[1] = box[5];
        }
        else if (str1 == "E") {
            temp += a[4];
            box[1] = a[1];
            box[3] = a[3];
            box[4] = a[4];
            box[6] = a[6];
            a[4] = box[1];
            a[6] = box[4];
            a[3] = box[6];
            a[1] = box[3];
        }
        else if (str1 == "W") {
            temp += a[3];
            box[1] = a[1];
            box[3] = a[3];
            box[4] = a[4];
            box[6] = a[6];
            a[1] = box[3];
            a[3] = box[6];
            a[6] = box[4];
            a[4] = box[1];
        }
        else {
            temp += a[5];
            box[1] = a[1];
            box[2] = a[2];
            box[5] = a[5];
            box[6] = a[6];
            a[1] = box[5];
            a[5] = box[6];
            a[6] = box[2];
            a[2] = box[1];
        }
    }
    printf("%d\n", temp);
}
return 0;
}




  

Compiler output:
a.cc:67:1: error: expected unqualified-id before 'return'
   67 | return 0;
      | ^~~~~~
a.cc:68:1: error: expected declaration before '}' token
   68 | }
      | ^
Language: C++

def North(dice):
    dice[0],dice[1] = dice[1],7-dice[0]

def East(dice):
    dice[2],dice[0] = dice[0],7-dice[2]

def West(dice):
    dice[0],dice[2] = dice[2],7-dice[0]

def South(dice):
    dice[1],dice[0] = dice[0],7-dice[1]

def Right(dice):
    dice[1],dice[2] = dice[2],7-dice[1]

def Left(dice):
    dice[2],dice[1] = dice[1],7-dice[2]

def main():
    dice = [1,2,3]
    sum = 1

    while 1:
        n = int(input())
        if not n:
            break
        for _ in range(n):
            eval(input()+"(dice)")
            sum += dice[0]
        print(sum)
        dice =  [1,2,3]
        sum = 1
    return 0
if __name__ == "__main__":
    main()

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def North(dice):
      | ^~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

void North();
void East();
void West();
void South();
void Right();
void Left();

   int up = 1, down = 6, north = 5, south = 2, east = 3, west = 4;
   int ans = 1;

int main(){
    string s;
    int n;
    cin >> n;

    for (int i = 0; i < n; i++){
        cin >> s;

        if (s == "North"){
            North();
        } else if (s == "East"){
            East();
        } else if (s == "West"){
            West();
        } else if (s == "South"){
            South();
        } else if (s == "Right") {
            Right();
        } else if (s == "Left") {
            Left();
        }
    }
    cout << ans << endl;
}

void North(){
    int temp;
    temp = up;
    up = south;
    south = down;
    down = north;
    north = temp;
    ans += up
}

void East(){
    int temp;
    temp = up;
    up = west;
    west = down;
    down = east;
    east = temp;
        ans += up
}

void West(){
    int temp;
    temp = up;
    up = east;
    east = down;
    down = west;
    west = temp;
        ans += up
}

void South(){
    int temp;
    temp = up;
    up = north;
    north = down;
    down = south;
    south = temp;
        ans += up
}

void Right(){
    int temp;
    temp = south;
    south = east;
    east = north;
    north = west;
    west = temp;
        ans += up
}

void Left(){
    int temp;
    temp = south;
    south = west;
    west = north;
    north = east;
    east = temp;
        ans += up
}

Compiler output:
a.cc: In function 'void North()':
a.cc:48:14: error: expected ';' before '}' token
   48 |     ans += up
      |              ^
      |              ;
   49 | }
      | ~             
a.cc: In function 'void East()':
a.cc:58:18: error: expected ';' before '}' token
   58 |         ans += up
      |                  ^
      |                  ;
   59 | }
      | ~                 
a.cc: In function 'void West()':
a.cc:68:18: error: expected ';' before '}' token
   68 |         ans += up
      |                  ^
      |                  ;
   69 | }
      | ~                 
a.cc: In function 'void South()':
a.cc:78:18: error: expected ';' before '}' token
   78 |         ans += up
      |                  ^
      |                  ;
   79 | }
      | ~                 
a.cc: In function 'void Right()':
a.cc:88:18: error: expected ';' before '}' token
   88 |         ans += up
      |                  ^
      |                  ;
   89 | }
      | ~                 
a.cc: In function 'void Left()':
a.cc:98:18: error: expected ';' before '}' token
   98 |         ans += up
      |                  ^
      |                  ;
   99 | }
      | ~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main() {
    int n, r;
    string s;
    vector<string> str;
    int top = 1;
    int left = 2;
    int front = 3;
    int _top, _left, _front;
    while (cin >> n, n != 0) {
        for (int i = 0; i < n; i++) {
            cin >> s;
            _top = top;
            _left = left;
            _front = front;
            if (s == "North") {
                _top = front;
                _front = 7 - top;
            }
            if (s == "East") {
                _top = 7 - left;
                _left = top;
            }
            if (s == "West") {
                _top = left;
                _left = 7 - top;
            }
            if (s == "South") {
                _top = 7 - front;
                _front = top;
            }
            if (s == "Right") {
                _left = front;
                front = 7 - left;
            }
            if (s == "Left") {
                _left = 7 - front;
                front = left;
            }
            top = _top;
            left = _left;
            front = _front;
        }
        cout << top << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<string> str;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:7:18: error: expected primary-expression before '>' token
    7 |     vector<string> str;
      |                  ^
a.cc:7:20: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |     vector<string> str;
      |                    ^~~
      |                    std
Language: C++

/*
 * joi.cpp
 *
 *  Created on: 2017/10/26
 *      Author: J00905
 */
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
	int n=5,s=2,e=3,w=4,t=1,b=6;
	int n,z;
	int p=0;
	char sn[10];
	while(1){
		cin>>n;
		if(n==0){
			break;
		}
		cin>>sn;
		for(int i=0;i<n;i++){
		if(sn[0]=="N"){
			z=t;
			t=s;
			s=b;
			b=n;
			n=z;
			p=p+t;
		}
		else if(sn[0]=="S"){
			z=t;
			t=n;
			n=b;
			b=s;
			s=z;
			p=p+t;
		}
		else if(sn[0]=="E"){
			z=t;
			t=w;
			w=b;
			b=e;
			e=z;
			p=p+t;
		}
		else if(sn[0]=="W"){
			z=t;
			t=e;
			e=b;
			b=w;
			w=z;
			p=p+t;
		}
			else if(sn[0]=="R"){
				z=s;
				s=e;
				e=n;
				n=w;
				w=z;
				p=p+t;
			}
			else if(sn[0]=="L"){
				z=s;
				s=w;
				w=n;
				n=e;
				s=z;
				p=p+t;
			}

		}
		cout<<p<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: redeclaration of 'int n'
   15 |         int n,z;
      |             ^
a.cc:14:13: note: 'int n' previously declared here
   14 |         int n=5,s=2,e=3,w=4,t=1,b=6;
      |             ^
a.cc:25:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |                 if(sn[0]=="N"){
      |                    ~~~~~^~~~~
a.cc:33:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |                 else if(sn[0]=="S"){
      |                         ~~~~~^~~~~
a.cc:41:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   41 |                 else if(sn[0]=="E"){
      |                         ~~~~~^~~~~
a.cc:49:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   49 |                 else if(sn[0]=="W"){
      |                         ~~~~~^~~~~
a.cc:57:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   57 |                         else if(sn[0]=="R"){
      |                                 ~~~~~^~~~~
a.cc:65:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   65 |                         else if(sn[0]=="L"){
      |                                 ~~~~~^~~~~
Language: C++


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
	int n=5,s=2,e=3,w=4,t=1,b=6;
	int n,z;
	int p=0;
	char sn[10];
	while(1){
		cin>>n;
		if(n==0){
			break;
		}
		cin>>sn;
		for(int i=0;i<n;i++){
		if(sn[0]=='N'){
			t=s;
			s=b;
			b=n;
			n=z;
			p=p+t;
		}
		else if(sn[0]=='S'){
			z=t;
			t=n;
			n=b;
			b=s;
			s=z;
			p=p+t;
		}
		else if(sn[0]=='E'){
			z=t;
			t=w;
			w=b;
			b=e;
			e=z;
			p=p+t;
		}
		else if(sn[0]=='W'){
			z=t;
			t=e;
			e=b;
			b=w;
			w=z;
			p=p+t;
		}
			else if(sn[0]=='R'){
				z=s;
				s=e;
				e=n;
				n=w;
				w=z;
				p=p+t;
			}
			else if(sn[0]=='L'){
				z=s;
				s=w;
				w=n;
				n=e;
				s=z;
				p=p+t;
			}

		}
		cout<<p<<endl;
		n=5,s=2,e=3,w=4,t=1,b=6;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: redeclaration of 'int n'
   10 |         int n,z;
      |             ^
a.cc:9:13: note: 'int n' previously declared here
    9 |         int n=5,s=2,e=3,w=4,t=1,b=6;
      |             ^
Language: C++


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
	int n=5,s=2,e=3,w=4,t=1,b=6;
	int y,z;
	int p=0;
	char sn[10];
	while(1){
		cin>>y;
		if(y==0){
			break;
		}

		for(int i=0;i<y;i++){
			cin>>sn;
			if(sn[0]=='N'){
				z=t;
				t=s;
				s=b;
				b=n;
				n=z;
				p=p+t;
			}
		else if(sn[0]=='S'){
			z=t;
			t=n;
			n=b;
			b=s;
			s=z;
			p=p+;
		}
		else if(sn[0]=='E'){
			z=t;
			t=w;
			w=b;
			b=e;
			e=z;
			p=p+t;
		}
		else if(sn[0]=='W'){
			z=t;
			t=e;
			e=b;
			b=w;
			w=z;
			p=p+t;
		}
			else if(sn[0]=='R'){
				z=s;
				s=e;
				e=n;
				n=w;
				w=z;
				p=p+t;
			}
			else if(sn[0]=='L'){
				z=s;
				s=w;
				w=n;
				n=e;
				s=z;
				p=p+t;
			}

		}
		cout<<p<<endl;
		n=5,s=2,e=3,w=4,t=1,b=6;
		p=0;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:29: error: expected primary-expression before ';' token
   35 |                         p=p+;
      |                             ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	int me[6];
	int cmp;
	int sum[5];
	int hasi;
	char str[6];
	sum[0]=1;
	sum[1]=1;
	sum[2]=1;
	sum[3]=1;
	sum[4]=1;
	sum[5]=1;
	for(int i=0;i<5;i++){
		cin >> n;
		if(n==0){
			hasi=i;
			break;
		}
		me[0]=1;
		me[1]=2;
		me[2]=3;
		me[3]=4;
		me[4]=5;
		me[5]=6;
			for(int i0=0;i0<n;i0++){
				cin >> str;
				if(strcmp(str,"North")==0){
					cmp=me[0];
					me[0]=me[1];
					me[1]=me[5];
					me[5]=me[4];
					me[4]=cmp;
				}
				else if(strcmp(str,"East")==0){
					cmp=me[0];
					me[0]=me[3];
					me[3]=me[5];
					me[5]=me[2];
					me[2]=cmp;
				}
				else if(strcmp(str,"West")==0){
					cmp=me[0];
					me[0]=me[2];
					me[2]=me[5];
					me[5]=me[3];
					me[3]=cmp;
				}
				else if(strcmp(str,"South")==0){
					cmp=me[0];
					me[0]=me[4];
					me[4]=me[5];
					me[5]=me[1];
					me[1]=cmp;
				}
				else if(strcmp(str,"Right")==0){
					cmp=me[1];
					me[1]=me[2];
					me[2]=me[4];
					me[4]=me[3];
					me[3]=cmp;
				}
				else if(strcmp(str,"Left")==0){
					cmp=me[1];
					me[1]=me[3];
					me[3]=me[4];
					me[4]=me[2];
					me[2]=cmp;
				}
				sum[i]+=me[0];
			}
			hasi=i;
	}
	for(int i=0;i<hasi;i++){
		cout << sum[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:36: error: 'strcmp' was not declared in this scope
   30 |                                 if(strcmp(str,"North")==0){
      |                                    ^~~~~~
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;
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	int me[6];
	int cmp;
	int sum[5];
	int hasi;
	char str[6];
	sum[0]=1;
	sum[1]=1;
	sum[2]=1;
	sum[3]=1;
	sum[4]=1;
	sum[5]=1;
	for(int i=0;i<5;i++){
		cin >> n;
		if(n==0){
			hasi=i;
			break;
		}
		me[0]=1;
		me[1]=2;
		me[2]=3;
		me[3]=4;
		me[4]=5;
		me[5]=6;
			for(int i0=0;i0<n;i0++){
				cin >> str;
				if(strcmp_s(str,"North")==0){
					cmp=me[0];
					me[0]=me[1];
					me[1]=me[5];
					me[5]=me[4];
					me[4]=cmp;
				}
				else if(strcmp_s(str,"East")==0){
					cmp=me[0];
					me[0]=me[3];
					me[3]=me[5];
					me[5]=me[2];
					me[2]=cmp;
				}
				else if(strcmp_s(str,"West")==0){
					cmp=me[0];
					me[0]=me[2];
					me[2]=me[5];
					me[5]=me[3];
					me[3]=cmp;
				}
				else if(strcmp_s(str,"South")==0){
					cmp=me[0];
					me[0]=me[4];
					me[4]=me[5];
					me[5]=me[1];
					me[1]=cmp;
				}
				else if(strcmp_s(str,"Right")==0){
					cmp=me[1];
					me[1]=me[2];
					me[2]=me[4];
					me[4]=me[3];
					me[3]=cmp;
				}
				else if(strcmp_s(str,"Left")==0){
					cmp=me[1];
					me[1]=me[3];
					me[3]=me[4];
					me[4]=me[2];
					me[2]=cmp;
				}
				sum[i]+=me[0];
			}
			hasi=i;
	}
	for(int i=0;i<hasi;i++){
		cout << sum[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:36: error: 'strcmp_s' was not declared in this scope
   30 |                                 if(strcmp_s(str,"North")==0){
      |                                    ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//BEGIN CUT HERE
struct Dice{
  int s[6];
  void roll(char c){
    //the view from above
    // N
    //W E
    // S
    //s[0]:top
    //s[1]:south
    //s[2]:east
    //s[3]:west
    //s[4]:north
    //s[5]:bottom
    int b;
    if(c=='E'){
      b=s[0];
      s[0]=s[3];
      s[3]=s[5];
      s[5]=s[2];
      s[2]=b;
    }
    if(c=='W'){
      b=s[0];
      s[0]=s[2];
      s[2]=s[5];
      s[5]=s[3];
      s[3]=b;
    }
    if(c=='N'){
      b=s[0];
      s[0]=s[1];
      s[1]=s[5];
      s[5]=s[4];
      s[4]=b;
    }
    if(c=='S'){
      b=s[0];
      s[0]=s[4];
      s[4]=s[5];
      s[5]=s[1];
      s[1]=b;
    }
    
    // migi neji 
    if(c=='R'){
      b=s[1];
      s[1]=s[2];
      s[2]=s[4];
      s[4]=s[3];
      s[3]=b;
    }
    
    if(c=='L'){
      b=s[1];
      s[1]=s[3];
      s[3]=s[4];
      s[4]=s[2];
      s[2]=b;
    }
    
  }
  int top() {
    return s[0];
  }
  int hash(){
    int res=0;
    for(int i=0;i<6;i++) res=res*256+s[i];
    return res;
  }
};
vector<Dice> makeDices(Dice d){
  vector<Dice> res;
  for(int i=0;i<6;i++){
    Dice t(d);
    if(i==1) t.roll('N'); 
    if(i==2) t.roll('S'); 
    if(i==3) t.roll('S'),t.roll('S');
    if(i==4) t.roll('L'); 
    if(i==5) t.roll('R'); 
    for(int k=0;k<4;k++){
      res.push_back(t);
      t.roll('E');
    }
  }
  return res;
}
//END CUT HERE

signed ITP1_11_A(){
  Dice d;
  for(int i=0;i<6;i++) cin >> d.s[i];
  string s;cin >> s;
  for(int i=0;i<(int)s.size();i++) d.roll(s[i]);
  cout << d.top() << endl;
  return 0;
}

/*
  verified on 2018/02/09
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A
*/

signed AOJ_0502(){
  Int n;
  while(cin>>n,n){
    Dice d;
    for(Int i=0;i<6;i++) d.s[i]=i+1;

    Int ans=d.top();
    for(Int i=0;i<n;i++){
      string s;
      cin>>s;
      d.roll(s[0]);
      ans+=d.top();
    }
    cout<<ans<<endl;
  }
  
  return 0;
}


/*
  verified on 2018/02/09
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0502
*/



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<windows.h>

using namespace std;

int dice[6] ={1, 3, 2, 6, 4, 5};
int sub[6];
int total = 0;

char East[] = "East";
char West[] = "West";
char North[]= "North";
char South[]= "South";
char Right[]= "Right";
char Left[] = "Left";

void copy_arr(void){
	for(int i = 0; i < 6; i++){
		sub[i] = dice[i];
	}
}

void change_dice(char s[]){
	if(strcmp(East,s) == 0){
		copy_arr();
		dice[0] = sub[4];		
		dice[1] = sub[0];
//		dice[2] = sub[2];
		dice[3] = sub[1];
		dice[4] = sub[3];
//		dice[5] = sub[5];
	}
	else if(strcmp(West,s) == 0){
		copy_arr();
		dice[0] = sub[1];		
		dice[1] = sub[3];
//		dice[2] = sub[2];
		dice[3] = sub[4];
		dice[4] = sub[0];
//		dice[5] = sub[5];
	}
	else if(strcmp(North,s) == 0){
		copy_arr();
		dice[0] = sub[2];		
//		dice[1] = sub[1];
		dice[2] = sub[3];
		dice[3] = sub[5];
//		dice[4] = sub[4];
		dice[5] = sub[0];
	}
	else if(strcmp(South,s) == 0){
		copy_arr();
		dice[0] = sub[5];		
//		dice[1] = sub[1];
		dice[2] = sub[0];
		dice[3] = sub[2];
//		dice[4] = sub[4];
		dice[5] = sub[3];
	}
	else if(strcmp(Right,s) == 0){
		copy_arr();
//		dice[0] = sub[0];		//ツ陛渉可サツづ按つオ
		dice[1] = sub[5];
		dice[2] = sub[1];
//		dice[3] = sub[3];
		dice[4] = sub[2];
		dice[5] = sub[4];
	}
	else if(strcmp(Left,s) == 0){
		copy_arr();
//		dice[0] = sub[0];		
		dice[1] = sub[2];
		dice[2] = sub[4];
//		dice[3] = sub[3];
		dice[4] = sub[5];
		dice[5] = sub[1];
	}
	else{
		cout << "ERR" << endl;
	}
	total += dice[0];
}

int main()
{
	char s[10000][6];
	int n;
	
	for(;;){
		cin >> n;
		if(n == 0){
			break;
		}
		
		for(int i = 0; i < n; i++){
			cin >> s[i];
		}
		
		for(int i = 0; i < n; i++){
	//		cout <<i <<":";
			change_dice(s[i]);
	//		cout << endl;
		}
		cout << total+1 << endl;
	}
}

Compiler output:
a.cc:3:9: fatal error: windows.h: No such file or directory
    3 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>

using namespace std;

int dice[6] ={1, 3, 2, 6, 4, 5};
int sub[6];
int total = 0;

char East[] = "East";
char West[] = "West";
char North[]= "North";
char South[]= "South";
char Right[]= "Right";
char Left[] = "Left";

void copy_arr(void){
	for(int i = 0; i < 6; i++){
		sub[i] = dice[i];
	}
}

void change_dice(char s[]){
	if(strcmp(East,s) == 0){
		copy_arr();
		dice[0] = sub[4];		
		dice[1] = sub[0];
//		dice[2] = sub[2];
		dice[3] = sub[1];
		dice[4] = sub[3];
//		dice[5] = sub[5];
	}
	else if(strcmp(West,s) == 0){
		copy_arr();
		dice[0] = sub[1];		
		dice[1] = sub[3];
//		dice[2] = sub[2];
		dice[3] = sub[4];
		dice[4] = sub[0];
//		dice[5] = sub[5];
	}
	else if(strcmp(North,s) == 0){
		copy_arr();
		dice[0] = sub[2];		
//		dice[1] = sub[1];
		dice[2] = sub[3];
		dice[3] = sub[5];
//		dice[4] = sub[4];
		dice[5] = sub[0];
	}
	else if(strcmp(South,s) == 0){
		copy_arr();
		dice[0] = sub[5];		
//		dice[1] = sub[1];
		dice[2] = sub[0];
		dice[3] = sub[2];
//		dice[4] = sub[4];
		dice[5] = sub[3];
	}
	else if(strcmp(Right,s) == 0){
		copy_arr();
//		dice[0] = sub[0];		//ツ陛渉可サツづ按つオ
		dice[1] = sub[5];
		dice[2] = sub[1];
//		dice[3] = sub[3];
		dice[4] = sub[2];
		dice[5] = sub[4];
	}
	else if(strcmp(Left,s) == 0){
		copy_arr();
//		dice[0] = sub[0];		
		dice[1] = sub[2];
		dice[2] = sub[4];
//		dice[3] = sub[3];
		dice[4] = sub[5];
		dice[5] = sub[1];
	}
	else{
		cout << "ERR" << endl;
	}
	total += dice[0];
}

int main()
{
	char s[10000][6];
	int n;
	
	for(;;){
		cin >> n;
		if(n == 0){
			break;
		}
		
		for(int i = 0; i < n; i++){
			cin >> s[i];
		}
		
		for(int i = 0; i < n; i++){
	//		cout <<i <<":";
			change_dice(s[i]);
	//		cout << endl;
		}
		cout << total+1 << endl;
	}
}

Compiler output:
a.cc: In function 'void change_dice(char*)':
a.cc:24:12: error: 'strcmp' was not declared in this scope
   24 |         if(strcmp(East,s) == 0){
      |            ^~~~~~
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 | #include<string>
Language: C++

#include<set>
int m[3][4] = {{5,1,2,4},{1,3,1,0},{0,2,3,2}};
int main(){
	for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
		for(char s[10];n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
			scanf("%s",s);
			d=-1;
			if(s[0]=='L')c+=3; 
			if(s[0]=='R')c++;
			if(s[0]=='W')d=1;
			if(s[0]=='N')d=0;
			if(s[0]=='E')d=3;
			if(s[0]=='S')d=2;
			if(d!=-1)
				a=m[a%3][(d+c+a/3*2)%4],
				b=m[b%3][(d+c+b/3*2)%4];
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:39: error: 'scanf' was not declared in this scope
    4 |         for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
      |                                       ^~~~~
a.cc:4:56: error: 'printf' was not declared in this scope
    4 |         for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
      |                                                        ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<set>
  +++ |+#include <cstdio>
    2 | int m[3][4] = {{5,1,2,4},{1,3,1,0},{0,2,3,2}};
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};
char s[99];
int main(){
	s[87]=1;s[78]=4;s[69]=3;s[83]=2;
	for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
		for(gets(s);n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
			d=s[*gets(s)];
			d?a=m[4*a+(d+c)%4],b=m[4*b+(d+c)%4]:c+=*s==76?3:1;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |                 for(gets(s);n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
      |                     ^~~~
      |                     getw
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;~scanf("%s",s);*s<60?printf(r?"%d\n":,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:
a.cc: In function 'int main()':
a.cc:2:170: error: expected primary-expression before ',' token
    2 | 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;~scanf("%s",s);*s<60?printf(r?"%d\n":,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(){	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:
a.cc: In function 'int main()':
a.cc:2:133: error: 'gets' was not declared in this scope; did you mean 'getw'?
    2 | 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));}
      |                                                                                                                                     ^~~~
      |                                                                                                                                     getw
Language: C++

#include<set>
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;~scanf("%s",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:
a.cc: In function 'int main()':
a.cc:5:46: error: 'scanf' was not declared in this scope
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",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));
      |                                              ^~~~~
a.cc:5:66: error: 'printf' was not declared in this scope
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",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));
      |                                                                  ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<set>
  +++ |+#include <cstdio>
    2 | 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;
Language: C++

#include<map>
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;~scanf("%s",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:
a.cc: In function 'int main()':
a.cc:5:46: error: 'scanf' was not declared in this scope
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",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));
      |                                              ^~~~~
a.cc:5:66: error: 'printf' was not declared in this scope
    5 |         for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",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));
      |                                                                  ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<map>
  +++ |+#include <cstdio>
    2 | 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;
Language: C++

N[]={ 6, 14, 18, 10,  2,  9, 22, 15,  1, 17, 23,  7,  3,  5, 21, 19,  0, 13, 20, 11,  4,  8, 16, 12};
E[]={13, 17,  9,  5,  8, 21, 14,  1, 16, 22,  6,  0,  4, 20, 18,  2, 12, 23, 10,  3, 11, 19, 15,  7};
R[]={ 3,  0,  1,  2,  7,  4,  5,  6, 11,  8,  9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22};
a=-1;
d;
char s[9];
main(c)
{
	for(;c-48&&scanf("%s",s);)
	{
		if((c=*s)<60)
			~a&&printf("%d\n",a),
			a=d=0;
		if(c=='N')d=N[d];
		if(c=='E')d=E[d];
		if(c=='W')d=E[E[E[d]]];
		if(c=='S')d=N[N[N[d]]];
		if(c=='R')d=R[d];
		if(c=='L')d=R[R[R[d]]];
		a+=d/4+1;
	}
}

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N[]={ 6, 14, 18, 10,  2,  9, 22, 15,  1, 17, 23,  7,  3,  5, 21, 19,  0, 13, 20, 11,  4,  8, 16, 12};
      | ^
a.cc:2:1: error: 'E' does not name a type
    2 | E[]={13, 17,  9,  5,  8, 21, 14,  1, 16, 22,  6,  0,  4, 20, 18,  2, 12, 23, 10,  3, 11, 19, 15,  7};
      | ^
a.cc:3:1: error: 'R' does not name a type
    3 | R[]={ 3,  0,  1,  2,  7,  4,  5,  6, 11,  8,  9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22};
      | ^
a.cc:4:1: error: 'a' does not name a type
    4 | a=-1;
      | ^
a.cc:5:1: error: 'd' does not name a type
    5 | d;
      | ^
a.cc:7:5: error: expected constructor, destructor, or type conversion before '(' token
    7 | main(c)
      |     ^
Language: C++

a=-1,A=65,d;
char
*N="GKSOCNWLDFVTBRXHAJUPEMQI",
*E="PHLTIDOXQAGWECSUMBKVJFNR",
s[9];
main(c)
{
for(;c-48&&scanf("%s",s);a+=d/4+1)
{
(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0;
if(c==78)d=N[d]-A;
if(c==69)d=E[d]-A;
if(c==87)d=E[E[E[d]-A]-A]-A;
if(c==83)d=N[N[N[d]-A]-A]-A;
if(c==82)d=d&28|d%4+1&3;
if(c==76)d=d&28|d%4+3&3;
}}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a=-1,A=65,d;
      | ^
a.cc:3:4: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    3 | *N="GKSOCNWLDFVTBRXHAJUPEMQI",
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:4:4: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    4 | *E="PHLTIDOXQAGWECSUMBKVJFNR",
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:5: error: expected constructor, destructor, or type conversion before '(' token
    6 | main(c)
      |     ^
Language: C++

main(n){for(;scanf("%d",&n),n;){char r[9];int a,b,d,c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]==69)a=0,b=2;if(r[0]==87)a=2,b=0;if(r[0]==83)a=0,b=1;if(r[0]==82)a=2,b=1;if(r[0]==76)a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(n){for(;scanf("%d",&n),n;){char r[9];int a,b,d,c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]==69)a=0,b=2;if(r[0]==87)a=2,b=0;if(r[0]==83)a=0,b=1;if(r[0]==82)a=2,b=1;if(r[0]==76)a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}}
      |     ^
Language: C++

#include <stdio.h>
int T,F,R,c,a,t;char s[9];
main()
{
for(;c+21&&gets(s);a+=T)
{
c=*s-69;
c<0?a&&printf("%d\n",a),a=0,T=1,F=2,R=3:0;
c==9?t=T,T=F,F=7-t:0;
c==14?t=F,F=T,T=7-t:0;
!c?t=R,R=T,T=7-t:0;
c==18?t=T,T=R,R=7-t:0;
c==13?t=F,F=R,R=7-t:0;
c==7?t=R,R=F,F=7-t:0;
}}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:12: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 | for(;c+21&&gets(s);a+=T)
      |            ^~~~
      |            getw
Language: C++

#import<ios>
int D,d,c,a,X=448;char s[9];
int main()
{
for(;cin>>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:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<ios>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: 'cin' was not declared in this scope
    5 | for(;cin>>s;a+=D/64)
      |      ^~~
Language: C++

#import<iostream>
int D,d,c,a,X=448;char s[9];
int main()
{
for(;cin>>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:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<iostream>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | for(;cin>>s;a+=D/64)
      |      ^~~
      |      std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#import<cstdio>
int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n--;r+=*d-48)scanf("%s",s),*s%6-4a=*s%5+*s%2*2+c&3,t=*d,*d=d[++a],d[++a-1]=d[5],d[5]=d[a%4+1],d[a%4+1]=t:c+=*s+3;}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:2:127: error: unable to find numeric literal operator 'operator""a'
    2 | int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n--;r+=*d-48)scanf("%s",s),*s%6-4a=*s%5+*s%2*2+c&3,t=*d,*d=d[++a],d[++a-1]=d[5],d[5]=d[a%4+1],d[a%4+1]=t:c+=*s+3;}
      |                                                                                                                               ^~
a.cc:2:199: error: found ':' in nested-name-specifier, expected '::'
    2 | int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n--;r+=*d-48)scanf("%s",s),*s%6-4a=*s%5+*s%2*2+c&3,t=*d,*d=d[++a],d[++a-1]=d[5],d[5]=d[a%4+1],d[a%4+1]=t:c+=*s+3;}
      |                                                                                                                                                                                                       ^
      |                                                                                                                                                                                                       ::
a.cc:2:198: error: 't' is not a class, namespace, or enumeration
    2 | int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n--;r+=*d-48)scanf("%s",s),*s%6-4a=*s%5+*s%2*2+c&3,t=*d,*d=d[++a],d[++a-1]=d[5],d[5]=d[a%4+1],d[a%4+1]=t:c+=*s+3;}
      |                                                                                                                                                                                                      ^
Language: C++

r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
main(t,c){s=!scanf("%d",&c),c?:exit(0);for(m=2,y=3;c--;s+=t)scanf("%s",&r),
r%=8,r-2?r-3?r-4?r-5?r-6?r-7?:mov(&t,&y):mov(&t,&m):mov(&y,&t):mov(&y,&m):mov(&m,&t):mov(&m,&y);
main(1,printf("%d\n",s+1));}

Compiler output:
a.cc:1:1: error: 'r' does not name a type
    1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
      | ^
a.cc:1:9: error: ISO C++ forbids declaration of 'mov' with no type [-fpermissive]
    1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
      |         ^~~
a.cc: In function 'int mov(int*, int*)':
a.cc:1:26: error: 'r' was not declared in this scope
    1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
      |                          ^
a.cc:1:44: warning: no return statement in function returning non-void [-Wreturn-type]
    1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
      |                                            ^
a.cc: At global scope:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(t,c){s=!scanf("%d",&c),c?:exit(0);for(m=2,y=3;c--;s+=t)scanf("%s",&r),
      |     ^
Language: C++

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


int main(void) {
	int top=1,front=2,right=3,n=0,sum=1,swap,;
	char opr;
	scanf("%d",&n);

	for(int i=0;i<n;i++){
		scanf("%s",&opr);
		switch (opr){
		case 'N':
			swap=top;
			top=front;
			front=(7-swap);
			break;
		case 'E':
			swap=right;
			right=top;
			top=(7-swap);
			break;
		case 'W':
			swap=top;
			top=right;
			right=(7-swap);
			break;
		case 'S':
			swap=front;
			front=top;
			top=(7-swap);
			break;
		case 'R':
			swap=front;
			front=right;
			right=(7-swap);
			break;
		case 'L':
			swap=right;
			right=front;
			front=(7-swap);
			break;

		}
		sum+=top;
	}
	printf("%d",sum);
	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:50: error: expected unqualified-id before ';' token
    6 |         int top=1,front=2,right=3,n=0,sum=1,swap,;
      |                                                  ^
Language: C++

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


int main() {
	int top=1,front=2,right=3,n=0,sum=1,swap,;
	char opr[10];
	scanf("%d",&n);

	for(int i=0;i<n;i++){
		for (int j=0;j<5;j++) scanf("%s",&opr[j]);
		switch (opr[0]){
		case 'N':
			swap=top;
			top=front;
			front=(7-swap);
			break;
		case 'E':
			swap=right;
			right=top;
			top=(7-swap);
			break;
		case 'W':
			swap=top;
			top=right;
			right=(7-swap);
			break;
		case 'S':
			swap=front;
			front=top;
			top=(7-swap);
			break;
		case 'R':
			swap=front;
			front=right;
			right=(7-swap);
			break;
		case 'L':
			swap=right;
			right=front;
			front=(7-swap);
			break;

		}
		sum+=top;
	}
	printf("%d",sum);
	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:50: error: expected unqualified-id before ';' token
    6 |         int top=1,front=2,right=3,n=0,sum=1,swap,;
      |                                                  ^
Language: C++

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

struct{
	char s[10];
	int d[6];
} map[6]={
{"North",{1,5,2,0,4,3}},
{"East" ,{2,1,5,3,0,4}},
{"West" ,{4,1,0,3,5,2}},
{"South",{3,0,2,5,4,1}},
{"Right",{0,2,3,4,1,5}},
{"Left" ,{0,4,1,2,3,5}}
};

int main(){
	int n;
	for(;cin>>n,n;){
		string s;
		int i,j,dice[6]={1,5,3,2,4,6},t[6],sum=1;
		for(;n--;){
			cin>>s;
			memcpy(t,dice,sizeof(t));
			for(i=0;i<6;i++)
				if(s==map[i].s)
					for(j=0;j<6;j++) dice[map[i].d[j]]=t[j];
			sum+=dice[0];
		}
		cout << sum << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: 'memcpy' was not declared in this scope
   24 |                         memcpy(t,dice,sizeof(t));
      |                         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main(){
	int n;
	string str;
	
	while(true){
		for(int i = 0; i < 3; i++){
			dice[i] = i + 1;
		}
		scanf("%d", &n);
                if( n == 0){ break;}


		// 初期値
		int count = 1;
		int temp;
		for(int i = 0; i < n; i++){
			cin >> str;
			temp = dice[0];

			if(str == "North"){
				dice[0] = dice[1];
				dice[1] = 7 - temp;
			}
			else if(str == "East"){
				dice[0] = 7 -dice[2];
				dice[2] = temp;
			}
			else if(str == "West"){
				dice[0] = dice[2];
				dice[2] = 7 - temp;
			}
			else if(str == "South"){
				dice[0] = 7 - dice[1];
				dice[1] = temp;
			}
			else if(str == "Right"){
				temp = dice[1];
				dice[1] = dice[2];
				dice[2] = 7 - dice[1];
			}
			else if(str == "Left"){
				temp = dice[1];
				dice[1] = 7 - dice[2];
				dice[2] = temp;
			}
			count += dice[0];
		}
		printf("%d\n", count);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'dice' was not declared in this scope
   12 |                         dice[i] = i + 1;
      |                         ^~~~
a.cc:23:32: error: 'dice' was not declared in this scope
   23 |                         temp = dice[0];
      |                                ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

class Dice {
private :
	void Swap( int &a, int &b ) { int t = a; a = b; b = t; }
public :
	union {
		struct _X {
			int back, front;
			int left, right;
			int bottom, top;
		} X;
		struct _Y {
			int top, bottom;
			int front, back;
			int left, right;
		} Y;
		struct _Z {
			int back, front;
			int top, bottom;
			int left, right;
		} Z;
		int d[6];
	};
	Dice ( int t, int bt, int f, int bk, int l, int r )
		{ Y.top = t; Y.bottom = bt; Y.front = f; Y.back = bk; Y.left = l; Y.right = r; }
	void RotLeftX	( int n );
	void RotLeftY	( int n );
	void RotLeftZ	( int n );
	void RotRightX	( int n );
	void RotRightY	( int n );
	void RotRightZ	( int n );
};

void Dice::RotLeftX ( int n ) {
	int m[] = { 2, 1, 3 }; // f, bt, bk
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[0], d[m[j]]); // t
	}
}
void Dice::RotLeftY ( int n ) {
	int m[] = { 2, 5, 3 }; // f, r, bk
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[4], d[m[j]]); // l
	}
}
void Dice::RotLeftZ ( int n ) {
	int m[] = { 5, 0, 4 }; // r, t, l
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[1], d[m[j]]); // bt
	}
}
void Dice::RotRightX ( int n ) {
	int m[] = { 3, 1, 2 }; // bk, bt, f
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[0], d[m[j]]); // t
	}
}
void Dice::RotRightY ( int n ) {
	int m[] = { 3, 5, 2 }; // bk, r, f
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[4], d[m[j]]); // l
	}
}
void Dice::RotRightZ ( int n ) {
	int m[] = { 4, 0, 5 }; // l, t, r
	for(int i=0; i < n; ++i) {
		for(int j=0; j < 3; ++j) Swap(d[1], d[m[j]]); // bt
	}
}

int main( void )
{
	int n;
	while(cin >> n, n) {
		string in;
		Dice dice(1, 6, 2, 5, 4, 3);
		int sum = 1;
		for(int i=0; i < n; ++i) {
			cin >> in;
			switch(in[0]) {
			case 'N':
				dice.RotRightX(1);
				break;
			case 'E':
				dice.RotRightZ(1);
				break;
			case 'W':
				dice.RotLeftZ(1);
				break;
			case 'S':
				dice.RotLeftX(1);
				break;
			case 'R':
				dice.RotRightY(1);
				break;
			case 'L':
				dice.RotLeftY(1);
				break;
			}
			sum += dice.Y.top;
		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc:11:24: error: 'struct Dice::<unnamed union>::_X' invalid; an anonymous union may only have public non-static data members [-fpermissive]
   11 |                 struct _X {
      |                        ^~
a.cc:16:24: error: 'struct Dice::<unnamed union>::_Y' invalid; an anonymous union may only have public non-static data members [-fpermissive]
   16 |                 struct _Y {
      |                        ^~
a.cc:21:24: error: 'struct Dice::<unnamed union>::_Z' invalid; an anonymous union may only have public non-static data members [-fpermissive]
   21 |                 struct _Z {
      |                        ^~