您的位置:首页 > 其它

Pocket Cube

2015-07-22 19:45 302 查看
看了别人的,mark一下

[code]#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: