目录
38多米诺骨牌(3)53(4)68(5)81(6)94(7)
106 多米诺骨牌(12)119(8)130(9)142(10)150(11)
数邻
找出棋盘上所有的相邻数对。每两个数字组成的数对只能出现一次。
4*5

5*6

6*7

首先很容易推出 (2,2)

智力游戏 多米诺骨牌
智力游戏中的关卡。
11多米诺骨牌(1)


这个是4*4的多米诺骨牌,规则类似幻方。

代码:
#include<iostream>
using namespace std;
int ifsame(int a, int b, int c, int d)//判断(a,b)和(c,d)是否相同
{
if (a == c && b == d || a == d && b == c)return 1;
return 0;
}
int f(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10, int x11, int x12, int x13, int x14, int x15, int x16)
////判断这8组有没有相同的
{
int shuzu[16] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16 };
for (int i = 0; i < 16; i += 2)for (int j = i + 2; j < 16; j += 2)
if (ifsame(shuzu[i], shuzu[i + 1], shuzu[j], shuzu[j + 1]))return 0;
return 1;
}
int main()
{
cout << "answer:" << endl;
int n = 1;
for (int i1 = 0; i1 < 7; i1++)for (int i2 = 0; i2 <= 6 - i1; i2++)for (int i3 = 0; i3 <= 6 - i1 - i2; i3++)
for (int i4 = 0; i4 <= 6 - i1; i4++)for (int i5 = 0; i5 <= 6 - i4; i5++)
for (int i6 = 0; i6 <= 6 - i4 - i5; i6++)for (int i7 = 0; i7 <= 6 - i1 - i4; i7++)
{
int i8 = i1 + i1 + i2 + i3 + i4 - i6 + i7 - 6;
int temp = 18 - i1 - i1 - i2 - i3 - i4 - i5 - i5 - i6 - i7 - i8;
if (temp % 2 == 0 && i8 >= 0 && temp >= 0)
{
int i9 = temp / 2, i10 = 6 - i1 - i2 - i3, i11 = 6 - i4 - i5 - i6, i12 = 6 - i7 - i8 - i9;
int i13 = 6 - i1 - i4 - i7, i14 = 6 - i2 - i5 - i8, i15 = 6 - i3 - i6 - i9, i16 = 6 - i1 - i5 - i9;
if (i14 >= 0 && i

最低0.47元/天 解锁文章
4331

被折叠的 条评论
为什么被折叠?



