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>

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 <stdlib.h>
#include <iostream>

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

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

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

	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 ( string::const_iterator& it =  inputedCommands.begin();
								  it != inputedCommands.end();
								++it )
	{
		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();

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:157:66: error: cannot bind non-const lvalue reference of type 'std::__cxx11::basic_string<char>::const_iterator&' to an rvalue of type 'std::__cxx11::basic_string<char>::const_iterator'
  157 |         for ( string::const_iterator& it =  inputedCommands.begin();
      |                                             ~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/vector:62,
                 from a.cc:114:
/usr/include/c++/14/bits/stl_iterator.h:1074:9: note:   after user-defined conversion: '__gnu_cxx::__normal_iterator<_Iterator, _Container>::__normal_iterator(const __gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter = char*; <template-parameter-2-2> = void; _Iterator = const char*; _Container = std::__cxx11::basic_string<char>]'
 1074 |         __normal_iterator(const __normal_iterator<_Iter, _Container>& __i)
      |         ^~~~~~~~~~~~~~~~~