#include <stdio.h>
char str[15] = {"\0"};
struct Cube
{
char ch1;
char ch2;
int isComp;
};
struct Cube c[6];
int main()
{
while (gets(str))
{
int isTurn = 0, i, j;
c[0].ch1 = str[0], c[0].ch2 = str[5], c[0].isComp = 0;
c[1].ch1 = str[1], c[1].ch2 = str[4], c[1].isComp = 0;
c[2].ch1 = str[2], c[2].ch2 = str[3], c[2].isComp = 0;
c[3].ch1 = str[6], c[3].ch2 = str[11], c[3].isComp = 0;
c[4].ch1 = str[7], c[4].ch2 = str[10], c[4].isComp = 0;
c[5].ch1 = str[8], c[5].ch2 = str[9], c[5].isComp = 0;
for (i = 0; i < 3; i ++)
for (j = 3; j < 6; j ++)
{
if (c[i].isComp == 0 && c[j].isComp == 0)
{
if (c[i].ch1 == c[j].ch1 && c[i].ch2 == c[j].ch2 ||
c[i].ch1 == c[j].ch2 && c[i].ch2 == c[j].ch1)
{
c[i].isComp = 1, c[j].isComp = 1;
break;
}
}
}
for (i = 0; i < 6; i ++)
if (c[i].isComp == 0)
isTurn = 1;
if (isTurn)
printf("FALSE\n");
else printf("TRUE\n");
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言