DEC-UPDATE
Posted hdu-2010
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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(‘ ‘)
#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 = 0; while(*test++ != ‘