模拟,将骰子反转后判断即可
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
while(cin >> str){
if(str[4]=='1'||str[5]=='1'){
char ch=str[4];
str[4]=str[3];
str[3]=str[5];
str[5]=str[2];
str[2]=ch;
}//如果1在上面或者下面就把它反转到一旁
while(str[0]!='1'){
char ch=str[0];
str[0]=str[3];
str[3]=str[1];
str[1]=str[2];
str[2]=ch;
}//将1固定到东的位置
while(str[2]!='2'){
char ch=str[4];
str[4]=str[3];
str[3]=str[5];
str[5]=str[2];
str[2]=ch;
}//将2固定到北的位置
if(str[4]=='3') cout << "right" << endl;
else cout << "left" << endl;
}
}