puzzle(1036)数邻、多米诺骨牌

目录

数邻

4*5

 5*6

 6*7

智力游戏 多米诺骨牌

11多米诺骨牌(1)

23多米诺骨牌(2)

38多米诺骨牌(3)53(4)68(5)81(6)94(7)

106 多米诺骨牌(12)119(8)130(9)142(10)150(11)

Domino(逻辑数字)

植此青绿

简单模式

困难模式


数邻

在线play

找出棋盘上所有的相邻数对。每两个数字组成的数对只能出现一次。

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值