DEC-UPDATE
12/19-12/26
# -*- coding: utf-8 -*- import sys
ans = [1,2,3,4,5,6] def operate(fun): a = ans[0]
b = ans[1]
c = ans[2]
d = ans[3]
e = ans[4]
f = ans[5] if fun == 'R':
ans[0] = d
ans[1] = c
ans[2] = a
ans[3] = b
elif fun == 'L':
ans[0] = c
ans[1] = d
ans[2] = b
ans[3] = a
elif fun == 'B': ##上
ans[2] = f
ans[3] = e
ans[4] = c
ans[5] = d
elif fun == 'C': ##下
ans[2] = e
ans[3] = f
ans[4] = d
ans[5] = c
elif fun == 'A': ##顺90
ans[0] = e
ans[1] = f
ans[4] = b
ans[5] = a
elif fun == 'F': ##逆90
ans[0] = f
ans[1] = e
ans[4] = a
ans[5] = b if __name__ == '__main__': while(True):
args = raw_input()
if args == 'q':
break
map(operate, args)
for e in ans:
sys.stdout.write(str(e))
ans = [1,2,3,4,5,6]
sys.stdout.write('\n')
Python CODE
#include <stdio.h>
#include <stdlib.h> #define INPUT 60 void L(int *ans);
void R(int *ans);
void F(int *ans);
void B(int *ans);
void A(int *ans);
void C(int *ans);
int getlen(char *test){
int c = ;
while(*test++ != '\0'){
c++;
} return c;
} int main()
{
int ans[] = {,,,,,};
char inputs[INPUT] = "";
int i = ; while(gets(inputs)){ for (i = ; i < getlen(inputs); i++){ if(inputs[i] == 'R'){
R(ans);
}else if(inputs[i] == 'L'){
L(ans);
}else if(inputs[i] == 'A'){
A(ans);
}else if(inputs[i] == 'B'){
B(ans);
}else if(inputs[i] == 'C'){
C(ans);
}else if(inputs[i] == 'F'){
F(ans);
}
}
for (i = ;i < ; i++){
printf("%d", ans[i]);
}
printf("\n");
for(i = ; i < ; i++){
ans[i] = i + ;
}
}
return ;
} void R(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
} void L(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void F(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
} void B(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void A(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void C(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
}
C CODE
DEC-UPDATE的更多相关文章
- [洛谷 P3787] 冰精冻西瓜
题目描述 琪露诺是拥有操纵冷气程度的能力的妖精,一天她发现了一片西瓜地.这里有n个西瓜,由n-1条西瓜蔓连接,形成一个有根树,琪露诺想要把它们冷冻起来慢慢吃. 这些西瓜蔓具有神奇的性质,可以将经过它的 ...
- [ecmagnet][python基础]有关git那些事
#1 git教程 # 注册git服务器用户,权限-- 注意这个和客户端用户不是一样 # 客户端(linux)提交代码到本地仓库(简单版,了解原理) a.安装git sudo apt-get insta ...
- OCM 12c | OCM 12c Update | OCM 11g (Retiring Dec 31, 2019) | OCM 11g考试延期至2020.04.30
OCM 全球考试安排时间表 View A Worldwide OCM Schedule Oracle Database 12c Certified Master Exam (OCM) OCM 12c ...
- BZOJ 1691: [Usaco2007 Dec]挑剔的美食家 [treap 贪心]
1691: [Usaco2007 Dec]挑剔的美食家 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 786 Solved: 391[Submit][S ...
- 教新手一步步解决:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to和更新gradle问题
android studio出现问题:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_O ...
- BZOJ3389: [Usaco2004 Dec]Cleaning Shifts安排值班
3389: [Usaco2004 Dec]Cleaning Shifts安排值班 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 45 Solved: ...
- 通过 yum update 将系统从CentOS 6.2 升级到 CentOS 6.6 及升级过程中的简单排错
本文说明 本文写于2014年的WP中,后WP停止维护,今天翻到此记录整理下,记录于此,方便日后查看. 话说那时候写博客真是认真啊~哈哈~ 升级前的系统信息 [root@thatsit ~]# unam ...
- BZOJ1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚
1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 414 Solved: ...
- Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to “*****”
Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment ...
- Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offli ...
随机推荐
- Vue组件中的data属性
Vue中的data属性专门用来以对象方式存放数据,它有两种用法. var vm=new Vue({ data:{a:1,b:2,}, }) var vm=new Vue({ data(){return ...
- flask 之(四) --- 扩展|缓存|会话
扩展 蓝图内置扩展 (实现的是路由的拆分) '''----------- app.py -------------''' from flask import Flask from users_view ...
- fio 硬盘测试工具
一.windows环境 1. 安装fio:http://www.bluestop.org/fio/ 可以选择不同版本的安装,安装后在C:\Program Files\fio目录中可以找到fio的执行程 ...
- 强化学习应用于游戏Tic-Tac-Toe
Tic-Tac-Toe游戏为3*3格子里轮流下棋,一方先有3子成直线的为赢家. 参考代码如下,我只删除了几个没用的地方: ####################################### ...
- 注入之Mysql-Getshell思路
- HanLP-分类模块的分词器介绍
最近发现一个很勤快的大神在分享他的一些实操经验,看了一些他自己关于hanlp方面的文章,写的挺好的!转载过来分享给大家!以下为分享原文(无意义的内容已经做了删除) 如下图所示,HanLP的分类模块中单 ...
- c++ split(getline实现)
众所周知 c++中string没有自带的split函数(亏你还是老大哥) 网上关于split函数的优秀写法很多 本人不再赘述 今几日翻C++API时发现了getline一个有趣的方法 istream& ...
- 下载安装npm和cnpm
下载安装npm http://nodejs.cn/download/ 下载安装cnpm 完成npm的安装后,再安装cnpm https://npm.taobao.org/ 切换源为 taobao 源 ...
- 使用Python基于百度等OCR API的文字识别
百度OCR Baidu OCR API:一定额度免费,目前是每日500次 Python SDK文档:https://cloud.baidu.com/doc/OCR/OCR-Python-SDK.htm ...
- Mac下的Web性能压力测试工具:ab(ApacheBench)
Web开发,少不了的就是压力测试,它是评估一个产品是否合格上线的基本标准. ab是一种用于测试Apache超文本传输协议(HTTP)服务器的工具.apache自带ab工具,可以测试Apache.IIS ...