intmain(){ string op; cin >> op; // 左 右 前 后 上 下 int status[7] = {0, 1, 2, 3 ,4, 5 ,6}; for(int i = 0; i < op.size(); i++){ switch(op[i]){ case'L': { // 前后不变,左上右下,左移一位 int left = status[1]; int up = status[5]; int right = status[2]; int down = status[6];
status[1] = up; status[5] = right; status[2] = down; status[6] = left; break; } case'R':{ int left = status[1]; int up = status[5]; int right = status[2]; int down = status[6]; //前后不变,左上右下,右移一位 status[1] = down; status[5] = left; status[2] = up; status[6] = right; break; } case'F':{ //左右不变,前下后上,右移一位 int front = status[3]; int down = status[6]; int rear = status[4]; int up = status[5];
status[3] = up; status[6] = front; status[4] = down; status[5] = rear; break; } case'B':{ //左右不变,前下后上,左移一位 int front = status[3]; int down = status[6]; int rear = status[4]; int up = status[5];
status[3] = down; status[6] = rear; status[4] = up; status[5] = front; break; } case'A':{ //上下不变,左前右后,右移一位 int left = status[1]; int front = status[3]; int right = status[2]; int rear = status[4];
status[1] = rear; status[3] = left; status[2] = front; status[4] = right; break; } case'C':{ //上下不变,左前右后,左移一位 int left = status[1]; int front = status[3]; int right = status[2]; int rear = status[4]; status[1] = front; status[3] = right; status[2] = rear; status[4] = left; break; } } } for(int i = 1; i < 7; i++){ cout << status[i]; } cout << endl; return0; }