solutionset.cpp

来自「爱因斯坦谜题」· C++ 代码 · 共 41 行

CPP
41
字号
// SolutionSet.cpp: implementation of the CSolutionSet class.
//
//////////////////////////////////////////////////////////////////////

#include "SolutionSet.h"

void CSolutionSet::Show(CString &buf, bool only_size) const
{
	int i;
	CSolution sln;
	CString s;

	buf.Format("-------------------- 一共有 %2d 个解 --------------------\n", m_nSize);
	if (only_size) {
		return;
	}

	for (i=0; i<m_nSize; i++) {
		s.Format("\n解%d\n", i+1);
		buf += s;
		sln = GetAt(i);
		sln.Show(s);
		buf += s;
	}
	buf += "\n";
}

void CSolutionSet::Show(bool only_size) const
{
	CString buf;
	Show(buf, only_size);
	printf("%s", buf);
}

CSolutionSet& CSolutionSet::operator=(const CSolutionSet &sln)
{
	RemoveAll();
	Append(sln);
	return *this;
}

⌨️ 快捷键说明

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