OpenJudge-合格的字符串

  • OpenJudge-合格的字符串


题目链接:1:合格的字符串

代码:

#include	
#include
#include
using namespace std;

int main()
{
	string *Answer;
	string Request;
	int num, begin, end;
	cin >> num;
	Answer = new string[num];
	for (int i = 0; i < num; i++)
		cin >> Answer[i];
	cin >> Request;
	

	begin = Request.find('[');
	end = Request.find(']');
	int Length = Request.length() - (end - begin);
	begin++;
	end--;

	for (int i = 0; i < num; i++)
	{
		int flag = 0;
		if (Answer[i].length() != Length)
			continue;
		for(int j=0;j

 

你可能感兴趣的:(字符串)