Pocket Cube

来源:互联网 发布:游戏服务器源码下载 编辑:程序博客网 时间:2024/05/01 17:11

看了别人的,mark一下

#include <iostream>#include <cstring>#include <cstdio>#include <cstdlib>#include <algorithm>using namespace std;int a[] = {-1,1,1,-1,1,-1,0,0,1,-1,-1,1,0,0,-1,1,-1,1,1,-1,0,0,0,0};int T;int main(){    scanf("%d",&T);    for(int re=1;re<=T;++re){        int ans = 0;        char ch[3];        for(int i=0;i<24;++i){            scanf("%s",ch);            if(ch[0] == 'w' || ch[0] == 'y')                ans += a[i];        }        printf("Case #%d: %s\n",re,ans%3?"NO":"YES");    }    return 0;}
0 0