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:8:1: error: unknown type name 'class'
    8 | class cDICE{
      | ^~~~~
main.c:8:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    8 | class cDICE{
      |            ^
main.c: In function 'main':
main.c:109:9: error: unknown type name 'cDICE'
  109 |         cDICE *DiceMgr;
      |         ^~~~~
main.c:112:19: error: 'new' undeclared (first use in this function)
  112 |         DiceMgr = new cDICE();
      |                   ^~~
main.c:112:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:112:22: error: expected ';' before 'cDICE'
  112 |         DiceMgr = new cDICE();
      |                      ^~~~~~
      |                      ;
main.c:114:16: error: request for member 'InputData' in something not a structure or union
  114 |         DiceMgr->InputData(Me,DiceMgr->mMe);
      |                ^~
main.c:114:38: error: request for member 'mMe' in something not a structure or union
  114 |         DiceMgr->InputData(Me,DiceMgr->mMe);
      |                                      ^~
main.c:119:32: error: request for member 'Rote' in something not a structure or union
  119 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                ^~
main.c:119:39: error: 'ROTETYPE' undeclared (first use in this function)
  119 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                       ^~~~~~~~
main.c:119:47: error: expected ')' before '::' token
  119 |                         DiceMgr->Rote(ROTETYPE::S);
      |                                      ~        ^~
      |                                               )
main.c:122:32: error: request for member 'Rote' in something not a structure or union
  122 |                         DiceMgr->Rote(ROTETYPE::W);
      |                                ^~
main.c:122:47: error: expected ')' before '::' token
  122 |                         DiceMgr->Rote(ROTETYPE::W);
      |                                      ~        ^~
      |                                               )
main.c:125:32: error: request for member 'Rote' in something not a structure or union
  125 |                         DiceMgr->Rote(ROTETYPE::E);
      |                                ^~
main.c:125:47: error: expected ')' before '::' token
  125 |                         DiceMgr->Rote(ROTETYPE::E);
      |                                      ~        ^~
      |                                               )
main.c:128:32: error: request for member 'Rote' in something not a structure or union
  128 |                         DiceMgr->Rote(ROTETYPE::N);
      |                                ^~
main.c:128:47: error: expected ')' before '::' token
  128 |                         DiceMgr->Rote(ROTETYPE::N);
      |                                      ~        ^~
      |                                               )
main.c:134:31: error: request for member 'GetLast' in something not a structure or union
  134 |         printf("%d\n", DiceMgr->GetLast());
      |                               ^~