Пример #1
0
int _tmain(int argc, _TCHAR* argv[])
{
	Anagrams anagrams;
	vector<string> teststrs;
	
	teststrs.push_back("abc");
	teststrs.push_back("acb");
	teststrs.push_back("abd");
	teststrs.push_back("cba");
	teststrs.push_back("cbab");
	teststrs.push_back("dba");
	teststrs.push_back("cab");

	vector<string> result = anagrams.anagrams(teststrs);

	for (unsigned int i = 0; i < result.size(); i++)
	{
		cout << result[i].c_str();

		if (strcmp("\r\n", result[i].c_str()) != 0)
		{
			cout << "\t";
		}
	}

	return 0;
}
Пример #2
0
int main() {
	Anagrams anagrams;
	vector<string> strs;
	strs.push_back("cab");
	strs.push_back("tin");
	strs.push_back("pew");
	strs.push_back("duh");
	strs.push_back("may");
	strs.push_back("ill");
	strs.push_back("buy");
	strs.push_back("bar");
	strs.push_back("max");
	strs.push_back("doc");
	vector<string> result = anagrams.anagrams(strs);
	for (vector<string>::iterator i = result.begin(); i != result.end(); i++)
		cout << *i << endl;
	system("pause");
}
Пример #3
0
int _tmain(int argc, _TCHAR* argv[])
{
	Anagrams anagrams;
	vector<string> teststrs;
	
	teststrs.push_back("abc");
	teststrs.push_back("acb");
	teststrs.push_back("acbd");

	vector<string> result = anagrams.anagrams(teststrs);

	for (unsigned int i = 0; i < result.size(); i++)
	{
		cout << result[i].c_str() << " ";
	}

	return 0;
}