⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queen.cpp

📁 一个硬件测试工具的源代码
💻 CPP
字号:
#include "queen.h"
#include <afxwin.h>



void CQueenApp::Versuch(int i)
{
	int j=1;
	int k=1;
	while (j<9)
	{
		if ((a[j])&&(b[i+j])&&(c[i-j+7]))
		{
			x[i]=j;
			a[j]=false; b[i+j]=false; c[i-j+7]=false;
			if (i<8) {Versuch(i+1);}
			a[j]=true;b[i+j]=true;c[i-j+7]=true;
		}
	++j;
	}
}

long CQueenApp::DoQueen(long wiederhole)
{
	long re=0;
	while (re<wiederhole)
	{
		int i=0;
		while (i<9) {a[i]=true;++i;}
		i=0;
		while (i<17) {b[i]=true;++i;}
		i=0;
		while (i<15) {c[i]=true;++i;}
		Versuch(1);
	++re;
	}
	return (1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -