UVa:253 - Cube painting

#include
int main(){
    char c1[6],c2[6],c[13];
    while(scanf("%s",c)!=EOF){
        for(int i=0;i<6;i++){
            c1[i]=c[i];
            c2[i]=c[i+6];
        }
        int t;
        for(int i=0;i<3;i++){
            t=0;
            for(int j=0;j<6;j++){
                if(c1[i]==c2[j]&&c1[5-i]==c2[5-j]){
                    t=1;
                    c2[j]=0;
                    c2[5-j]=0;
                    break;
                }
            }
            if(!t) break;
        }
        if(t) printf("TRUE\n");
        else printf("FALSE\n");
    }
    return 0;
}


--------------------------------------------------------------------------------------------

          Keep It Simple,Stupid!

--------------------------------------------------------------------------------------------

你可能感兴趣的:(OJ:UVa,题目分类:数学基础)