Sicily 1128. DICE
来源:互联网 发布:淘宝店叶琳儿彩妆真假 编辑:程序博客网 时间:2024/05/11 12:56
模拟,将骰子反转后判断即可
#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;}}
0 0
- Sicily 1128. DICE
- sicily 1128. DICE
- Sicily 1128. DICE
- Sicily 13907. Dice Game
- Sicily 7966. Another Dice Game
- 1128. DICE
- Dice
- sicily1128.DICE
- Dice Throwing
- poj4014 Dice
- Dice (bfs)
- HDU5012 Dice
- hdu5012 Dice
- Dice Possibility
- Dice's coefficient
- FOJ 1174 Dice Stacking
- Loaded dice 暗中搞鬼
- pku1972 Dice Stacking
- cookie解析
- String,StringBuffer,StringBuilder,StringWriter的效率差
- Android SharedPreference中的几种模式说明
- Java Basic5(反射,多线程)
- C++学习笔记—srand()和rand()
- Sicily 1128. DICE
- API开发第四篇:定义客户端/服务端接口协议
- 空指针异常
- ng-messages 的$dirty 使用
- 资源字符串的通配
- NSIndexSet的使用(一)
- Quartz学习, JAVA定时器
- 《iOS高级内存管理编程指南》学习笔记
- jquery实现网页导航特效