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

📄 magicsquare.h

📁 这是一个代码,可以实现任意阶的幻方的计算(6除外)
💻 H
字号:
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

const	int	MAX=100;
class __declspec(dllimport) MagicSquare
{
public:
	MagicSquare();
	~MagicSquare();
	void Init(int n);
	void SetType(int i);
	void StartChange();
	bool Check();
	bool SaveToFile(char * szPath);
protected:
	//////////////////////////////////////////////////////////////////////////
	void Reverse(int &a, int &b);
	void MainChange();
	//
	// 重排米字过程
	//
	bool ReChange();
	//////////////////////////////////////////////////////////////////////////
	//幻方数组
	int		Array[MAX][MAX];
	//自然数组
	int		ArrayInit[MAX][MAX];
	int		m_nType;
	int		m_nN;
	int		m_nA;
	int		m_nB;
	int		m_nW;
	int		m_nV;
	int		m_nM;
private:
};

⌨️ 快捷键说明

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