UVa 253 Cube paiting

题意:输入两个骰子,判断是否等价

因为每一个面可以作顶面,共6*4种情况,枚举就可以了

 #include<iostream>
#include<cstdio>
#include<cstring>
#include <cmath>
#include<stack>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#define mod=1e9+7;
using namespace std; typedef long long LL;
char s[],t[],a[][]; int main(){
int i,j,n,len;
while(cin>>(s+)){
memset(a,,sizeof(a)); strcpy(t,(s+)); //--------1----
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; //----2-------- a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; //--------3-------
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; //--------4--------
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
//-------5---------
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; //------6---------
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[];
a[][]=s[]; int flag=;
for(i=;i<=;i++){
if(strcmp(a[i],t)==){
printf("TRUE\n");
flag=;
break;
}
}
if(!flag)
printf("FALSE\n");
}
return ;
}

话说应该写一个旋转骰子的函数的吧= =可是不懂写,于是写下了6*4*6=144行代码来旋转骰子= =

如果是让输入是n面体的话,就不能这样了的说,一会儿搜下题解看看别人的旋转怎么写的

上一篇:POJ 3469 Dual Core CPU (最小割建模)


下一篇:SQL学习笔记:基础教程