game-engineer:classes:2022:game-programing-2:first-term:1:01-16-xx20

#include <iostream>
#include <forward_list>
 
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::forward_list;
 
bool IsContainsString(string str)
{
	forward_list<string> sList{ "technology", "techfull", "techful","fully" ,"full", };
	while (!str.empty() && !sList.empty())
	{
		string s = sList.front();
 
		while (true)
		{
			std::string::size_type pos = str.find(s);
			if (pos == std::string::npos)
				break;
			else
				str.erase(pos, pos + s.length());
		}
		sList.pop_front();
	}
	if (str.empty())
		return(true);
	else
		return(false);
}
 
int main() {
	int n;
	string tmp;
	cin >> n >> tmp;
	if (IsContainsString(tmp))
	{
		cout << "yes" << endl;
	}
	else
	{
		cout << "no" << endl;
	}
}
  • game-engineer/classes/2022/game-programing-2/first-term/1/01-16-xx20.txt
  • 最終更新: 3年前
  • by root