Language: C++

/*
*	File Name	:.cpp
*	Author		:
*	Date		:
*	Explain		:
*/

#include <map>
#include <string>
using namespace std;
// 1<-here
//2345
// 6
//

//	{1,2,3,4,5,6}
map<string,int[6]> table;
	table["North"]={3,2,6,4,1,5}};//north
	table["East"]={2,6,3,1,5,4}};//east
	table["West"]={4,1,3,6,5,2}};//west
	table["South"]={5,2,1,4,6,3};//south
	table["Right"]={1,5,2,3,4,6};//right
	table["Left"]={1,3,4,5,2,6}};//left


// 1
//4235
// 6
int init[6]={1,4,2,3,5,6};

int view[6]={1,4,2,3,5,6};
int copy[6]={1,4,2,3,5,6};

void init(){
	for(int i=0;i<6;i++){
		view[i]=init[i];
	}
}

void rotate(string id){
	for(int i=0;i<6;i++){
		copy[i]=view[table[id][i]];
	}
	for(int i=0;i<6;i++){
		view[i]=copy[i];
	}
}

int main(){

	bool flag=false;
	string name="";
	int ans=0;
	do{
		ans=0;
		init();
		flag=false;
		cin >> max;
		for(int i=0;i<max;i++){
			flag=true;
			cin>>name;
			rotate(name);
			ans+=view[0];
		}
		if (flag){cout << ans;}
	}while(flag);
	return 0;
}

Compiler output:
a.cc:18:9: error: 'table' does not name a type; did you mean 'mutable'?
   18 |         table["North"]={3,2,6,4,1,5}};//north
      |         ^~~~~
      |         mutable
a.cc:18:37: error: expected declaration before '}' token
   18 |         table["North"]={3,2,6,4,1,5}};//north
      |                                     ^
a.cc:19:9: error: 'table' does not name a type; did you mean 'mutable'?
   19 |         table["East"]={2,6,3,1,5,4}};//east
      |         ^~~~~
      |         mutable
a.cc:19:36: error: expected declaration before '}' token
   19 |         table["East"]={2,6,3,1,5,4}};//east
      |                                    ^
a.cc:20:9: error: 'table' does not name a type; did you mean 'mutable'?
   20 |         table["West"]={4,1,3,6,5,2}};//west
      |         ^~~~~
      |         mutable
a.cc:20:36: error: expected declaration before '}' token
   20 |         table["West"]={4,1,3,6,5,2}};//west
      |                                    ^
a.cc:21:9: error: 'table' does not name a type; did you mean 'mutable'?
   21 |         table["South"]={5,2,1,4,6,3};//south
      |         ^~~~~
      |         mutable
a.cc:22:9: error: 'table' does not name a type; did you mean 'mutable'?
   22 |         table["Right"]={1,5,2,3,4,6};//right
      |         ^~~~~
      |         mutable
a.cc:23:9: error: 'table' does not name a type; did you mean 'mutable'?
   23 |         table["Left"]={1,3,4,5,2,6}};//left
      |         ^~~~~
      |         mutable
a.cc:23:36: error: expected declaration before '}' token
   23 |         table["Left"]={1,3,4,5,2,6}};//left
      |                                    ^
a.cc:34:11: error: 'void init()' redeclared as different kind of entity
   34 | void init(){
      |           ^
a.cc:29:5: note: previous declaration 'int init [6]'
   29 | int init[6]={1,4,2,3,5,6};
      |     ^~~~
a.cc: In function 'void rotate(std::string)':
a.cc:42:17: error: reference to 'copy' is ambiguous
   42 |                 copy[i]=view[table[id][i]];
      |                 ^~~~
In file included from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/map:62,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)'
  642 |     copy(_II __first, _II __last, _OI __result)
      |     ^~~~
a.cc:32:5: note:                 'int copy [6]'
   32 | int copy[6]={1,4,2,3,5,6};
      |     ^~~~
a.cc:45:25: error: reference to 'copy' is ambiguous
   45 |                 view[i]=copy[i];
      |                         ^~~~
/usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)'
  642 |     copy(_II __first, _II __last, _OI __result)
      |     ^~~~
a.cc:32:5: note:                 'int copy [6]'
   32 | int copy[6]={1,4,2,3,5,6};
      |     ^~~~
a.cc: In function 'int main()':
a.cc:56:21: error: 'init' cannot be used as a function
   56 |                 init();
      |                 ~~~~^~
a.cc:58:17: error: 'cin' was not declared in this scope
   58 |                 cin >> max;
      |                 ^~~
a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #include <string>
  +++ |+#include <iostream>
   10 | using namespace std;
a.cc:59:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   59 |                 for(int i=0;i<max;i++){
      |                             ~^~~~
a.cc:65:27: error: 'cout' was not declared in this scope
   65 |                 if (flag){cout << ans;}
      |                           ^~~~
a.cc:65:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'