Language: C++

#pragma once

// ???????????¢?????????
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:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc:121:8: error: 'string' was not declared in this scope
  121 | vector<string> split(const string &str, char delim){
      |        ^~~~~~
a.cc:118:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  117 | #include <string.h>
  +++ |+#include <string>
  118 | 
a.cc:121:14: error: template argument 1 is invalid
  121 | vector<string> split(const string &str, char delim){
      |              ^
a.cc:121:14: error: template argument 2 is invalid
a.cc:121:28: error: 'string' does not name a type; did you mean 'stdin'?
  121 | vector<string> split(const string &str, char delim){
      |                            ^~~~~~
      |                            stdin
a.cc: In function 'int split(const int&, char)':
a.cc:122:16: error: 'string' was not declared in this scope
  122 |         vector<string> res;
      |                ^~~~~~
a.cc:122:16: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:122:22: error: template argument 1 is invalid
  122 |         vector<string> res;
      |                      ^
a.cc:122:22: error: template argument 2 is invalid
a.cc:124:29: error: request for member 'find_first_of' in 'str', which is of non-class type 'const int'
  124 |         while ((found = str.find_first_of(delim, current)) != string::npos){
      |                             ^~~~~~~~~~~~~
a.cc:124:63: error: 'string' is not a class, namespace, or enumeration
  124 |         while ((found = str.find_first_of(delim, current)) != string::npos){
      |                                                               ^~~~~~
a.cc:125:21: error: request for member 'push_back' in 'res', which is of non-class type 'int'
  125 |                 res.push_back(string(str, current, found - current));
      |                     ^~~~~~~~~
a.cc:128:13: error: request for member 'push_back' in 'res', which is of non-class type 'int'
  128 |         res.push_back(string(str, current, str.size() - current));
      |             ^~~~~~~~~
a.cc:128:48: error: request for member 'size' in 'str', which is of non-class type 'const int'
  128 |         res.push_back(string(str, current, str.size() - current));
      |                                                ^~~~
a.cc: At global scope:
a.cc:134:1: error: '::main' must return 'int'
  134 | void main( int argc, char *argv[] )
      | ^~~~
a.cc: In function 'int main(int, char**)':
a.cc:137:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
  137 |                 return;
      |                 ^~~~~~
a.cc:143:37: error: invalid initialization of reference of type 'const int&' from expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
  143 |                 diceNumbers = split(inputedDiceNumbers, ' ');
      |                                     ^~~~~~~~~~~~~~~~~~
a.cc:121:36: note: in passing argument 1 of 'int split(const int&, char)'
  121 | vector<string> split(const string &str, char delim){
      |                      ~~~~~~~~~~~~~~^~~
a.cc:147:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
  147 |                 return;
      |                 ^~~~~~