Language: C++

// ???????????¢?????????
class DiceSurface
{
private:
	unsigned short	number_;	// ????????¢??????????????????

public:
	DiceSurface() {}
	DiceSurface(const unsigned short& number)
		: number_(number)
	{}

	~DiceSurface() {}

	// ?????????
	void setNumber(const unsigned short& number) { number_ = number; }
	// ?????????
	unsigned short getNumber() const { return number_; }

};


class Dice
{
private:
	const DiceSurface* top_;	// ?????¢
	const DiceSurface* north_;	// ?????¢
	const DiceSurface* south_;	// ?????¢
	const DiceSurface* east_; 	// ??±??¢
	const DiceSurface* west_; 	// ?\???¢
	const DiceSurface* bottom_;	// ?????¢

private:
	Dice() {}

public:
	Dice( const unsigned short& topNumber
		, const unsigned short& northNumber
		, const unsigned short& southNumber
		, const unsigned short& eastNumber
		, const unsigned short& westNumber
		, const unsigned short& bottomNumber )
	{
		top_	= new DiceSurface(topNumber);
		north_	= new DiceSurface(northNumber);
		south_	= new DiceSurface(southNumber);
		east_	= new DiceSurface(eastNumber);
		west_	= new DiceSurface(westNumber);
		bottom_	= new DiceSurface(bottomNumber);
	}

	~Dice() {
		delete top_;		
		delete north_;
		delete south_;
		delete east_; 
		delete west_; 
		delete bottom_;
	}

	unsigned short getTopNumber() {
		return top_->getNumber();
	}

	void rotateNorth() {
		const DiceSurface* tmp = top_;
		top_	= south_;
		south_	= bottom_;
		bottom_	= north_;
		north_	= tmp;
	}

	void rotateSouth() {
		const DiceSurface* tmp = top_;
		top_	= north_;
		north_	= bottom_;
		bottom_	= south_;
		south_	= tmp;
	}

	void rotateEast() {
		const DiceSurface* tmp = top_;
		top_	= west_;
		west_	= bottom_;
		bottom_	= east_;
		east_	= tmp;
	}

	void rotateWest() {
		const DiceSurface* tmp = top_;
		top_	= east_;
		east_	= bottom_;
		bottom_ = west_;
		west_	= tmp;
	}

	void rotateClockwise() {
		const DiceSurface* tmp = north_;
		north_	= west_;
		west_	= south_;
		south_	= east_;
		east_	= tmp;
	}

	void rotateAnticlockwise() {
		const DiceSurface* tmp = north_;
		north_	= east_;
		east_	= south_;
		south_	= west_;
		west_	= tmp;
	}
};

#include<vector>
#include <string.h>

using namespace std;

vector<string> split(const string &str, char delim){
	vector<string> res;
	size_t current = 0, found;
	while ((found = str.find_first_of(delim, current)) != string::npos){
		res.push_back(string(str, current, found - current));
		current = found + 1;
	}
	res.push_back(string(str, current, str.size() - current));
	return res;
}

#include <iostream>

void main( int argc, char *argv[] )
{
	if ( argc < 3 ) {
		return;
	}

	vector<string> diceNumbers;
	{
		string inputedDiceNumbers(argv[1]);
		diceNumbers = split(inputedDiceNumbers, ' ');
	}

	if ( diceNumbers.size() < 6 ) {
		return;
	}

	Dice dice((unsigned short)atoi(diceNumbers[0].c_str())		// ?????¢
			, (unsigned short)atoi(diceNumbers[4].c_str())		// ?????¢
			, (unsigned short)atoi(diceNumbers[1].c_str())		// ?????¢
			, (unsigned short)atoi(diceNumbers[2].c_str())		// ??±??¢
			, (unsigned short)atoi(diceNumbers[3].c_str())		// ?\???¢
			, (unsigned short)atoi(diceNumbers[5].c_str()));	// ?????¢

	string inputedCommands(argv[2]);
	for ( const auto& it : inputedCommands ) {
		if ( it == 'N' ) {
			dice.rotateNorth();
		} else if ( it == 'S' ) {
			dice.rotateSouth();
		} else if ( it == 'E' ) {
			dice.rotateEast();
		} else if ( it == 'W' ) {
			dice.rotateWest();
		}
	}
	
	cout << dice.getTopNumber();
}

Compiler output:
a.cc:119:8: error: 'string' was not declared in this scope
  119 | vector<string> split(const string &str, char delim){
      |        ^~~~~~
a.cc:116:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  115 | #include <string.h>
  +++ |+#include <string>
  116 | 
a.cc:119:14: error: template argument 1 is invalid
  119 | vector<string> split(const string &str, char delim){
      |              ^
a.cc:119:14: error: template argument 2 is invalid
a.cc:119:28: error: 'string' does not name a type; did you mean 'stdin'?
  119 | vector<string> split(const string &str, char delim){
      |                            ^~~~~~
      |                            stdin
a.cc: In function 'int split(const int&, char)':
a.cc:120:16: error: 'string' was not declared in this scope
  120 |         vector<string> res;
      |                ^~~~~~
a.cc:120:16: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:120:22: error: template argument 1 is invalid
  120 |         vector<string> res;
      |                      ^
a.cc:120:22: error: template argument 2 is invalid
a.cc:122:29: error: request for member 'find_first_of' in 'str', which is of non-class type 'const int'
  122 |         while ((found = str.find_first_of(delim, current)) != string::npos){
      |                             ^~~~~~~~~~~~~
a.cc:122:63: error: 'string' is not a class, namespace, or enumeration
  122 |         while ((found = str.find_first_of(delim, current)) != string::npos){
      |                                                               ^~~~~~
a.cc:123:21: error: request for member 'push_back' in 'res', which is of non-class type 'int'
  123 |                 res.push_back(string(str, current, found - current));
      |                     ^~~~~~~~~
a.cc:126:13: error: request for member 'push_back' in 'res', which is of non-class type 'int'
  126 |         res.push_back(string(str, current, str.size() - current));
      |             ^~~~~~~~~
a.cc:126:48: error: request for member 'size' in 'str', which is of non-class type 'const int'
  126 |         res.push_back(string(str, current, str.size() - current));
      |                                                ^~~~
a.cc: At global scope:
a.cc:132:1: error: '::main' must return 'int'
  132 | void main( int argc, char *argv[] )
      | ^~~~
a.cc: In function 'int main(int, char**)':
a.cc:135:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
  135 |                 return;
      |                 ^~~~~~
a.cc:141:37: error: invalid initialization of reference of type 'const int&' from expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
  141 |                 diceNumbers = split(inputedDiceNumbers, ' ');
      |                                     ^~~~~~~~~~~~~~~~~~
a.cc:119:36: note: in passing argument 1 of 'int split(const int&, char)'
  119 | vector<string> split(const string &str, char delim){
      |                      ~~~~~~~~~~~~~~^~~
a.cc:145:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
  145 |                 return;
      |                 ^~~~~~