Language: C

#include <stdio.h>
enum ROTETYPE
{
	W,
	E,
	S,
	N
};
class cDICE
{
public:
	cDICE(){ Init(); };
	~cDICE(){};
	void Init(){
		int Me[6] = { 1, 2, 4, 8, 16, 32 };
		int Dice[6] = { 0, 1, 2, 3, 4, 5 };
		int Rote[2][4] = {
			{ 0, 1, 5, 4 },
			{ 2, 5, 3, 0 }
		};
		InputData(Dice, mDice);
		InputData(Me, mMe);
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < 4; j++){
				mRote[i][j] = Rote[i][j];
			}
		}
	}
	void Draw(){
		//??¨???????????????
		for (int i = 0; i < 6; i++){
			printf("???????????????:%d >> ??????????????????:%d\n", mMe[i], mDice[i]);
		}
	};
	void LastDraw(){
		//?????????????????????????´¢?????????
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				printf("?????????????????????:%d\n", mMe[i]);
				break;
			}
		}
	}
	int GetLast(){
		int Last = 0;
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				Last = mMe[i];
				break;
			}
		}
		return Last;
	}
	void Rote(ROTETYPE _TYPE){
		int Add = 1;
		if (_TYPE == ROTETYPE::S || _TYPE == ROTETYPE::W){ Add = 3; };
		switch (_TYPE){
		case ROTETYPE::W:
			RoteH(3);
			break;
		case ROTETYPE::E:
			RoteH(1);
			break;
		case ROTETYPE::S:
			RoteV(3);
			break;
		case ROTETYPE::N:
			RoteV(1);
			break;
		}
	}
	void InputData(int _Dice[6], int _Inp[6]){
		for (int i = 0; i < 6; i++){
			_Inp[i] = _Dice[i];
		}
	}
public:
	int mMe[6];
private:
	
	void RoteV(int _Add){			//1????¬?3??????
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[0][j]){
					//int ans = (mDice[i] <= 1) ? mDice[i] : -mDice[i] + 7;
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[0][ans];
					break;
				}
			}
		}
	};	//????????¢
	void RoteH(int _Add){
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[1][j]){
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[1][ans];
					break;
				}
			}
		}
	};	//?¨??????¢
private:
	int mDice[6];
	int mRote[2][4];
};
int main(){
	cDICE *DiceMgr;
	char Direct[100];
	int Me[6];
	DiceMgr = new cDICE();
	scanf("%d %d %d %d %d %d", &Me[0], &Me[1], &Me[2], &Me[3], &Me[4], &Me[5]);
	DiceMgr->InputData(Me,DiceMgr->mMe);
	scanf("%s", Direct);
	for (int i = 0; Direct[i] != '\0'; i++){
		switch (Direct[i]){
		case 'S':
			DiceMgr->Rote(ROTETYPE::S);
			break;
		case 'W':
			DiceMgr->Rote(ROTETYPE::W);
			break;
		case 'E':
			DiceMgr->Rote(ROTETYPE::E);
			break;
		case 'N':
			DiceMgr->Rote(ROTETYPE::N);
			break;
		}
	}
	//DiceMgr->Draw();
	//DiceMgr->LastDraw();
	printf("%d\n", DiceMgr->GetLast());
	return 0;
}

Compiler output:
main.c:9:1: error: unknown type name 'class'
    9 | class cDICE
      | ^~~~~
main.c:10:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   10 | {
      | ^
main.c: In function 'main':
main.c:111:9: error: unknown type name 'cDICE'
  111 |         cDICE *DiceMgr;
      |         ^~~~~
main.c:114:19: error: 'new' undeclared (first use in this function)
  114 |         DiceMgr = new cDICE();
      |                   ^~~
main.c:114:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:114:22: error: expected ';' before 'cDICE'
  114 |         DiceMgr = new cDICE();
      |                      ^~~~~~
      |                      ;
main.c:116:16: error: request for member 'InputData' in something not a structure or union
  116 |         DiceMgr->InputData(Me,DiceMgr->mMe);
      |                ^~
main.c:116:38: error: request for member 'mMe' in something not a structure or union
  116 |         DiceMgr->InputData(Me,DiceMgr->mMe);
      |                                      ^~
main.c:121:32: error: request for member 'Rote' in something not a structure or union
  121 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                ^~
main.c:121:39: error: 'ROTETYPE' undeclared (first use in this function)
  121 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                       ^~~~~~~~
main.c:121:47: error: expected ')' before '::' token
  121 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                      ~        ^~
      |                                               )
main.c:124:32: error: request for member 'Rote' in something not a structure or union
  124 |                         DiceMgr->Rote(ROTETYPE::W);
      |                                ^~
main.c:124:47: error: expected ')' before '::' token
  124 |                         DiceMgr->Rote(ROTETYPE::W);
      |                                      ~        ^~
      |                                               )
main.c:127:32: error: request for member 'Rote' in something not a structure or union
  127 |                         DiceMgr->Rote(ROTETYPE::E);
      |                                ^~
main.c:127:47: error: expected ')' before '::' token
  127 |                         DiceMgr->Rote(ROTETYPE::E);
      |                                      ~        ^~
      |                                               )
main.c:130:32: error: request for member 'Rote' in something not a structure or union
  130 |                         DiceMgr->Rote(ROTETYPE::N);
      |                                ^~
main.c:130:47: error: expected ')' before '::' token
  130 |                         DiceMgr->Rote(ROTETYPE::N);
      |                                      ~        ^~
      |                                               )
main.c:136:31: error: request for member 'GetLast' in something not a structure or union
  136 |         printf("%d\n", DiceMgr->GetLast());
      |                               ^~