코드
#include <iostream>
#include <string>
int main()
{
std::string first;
std::string second;
std::string Check="";
std::cin >> first >> second;
int firstLen = first.size();
int secondLen = second.size();
for (int i = 0; i < firstLen; i++)
{
Check += first[i];
if (Check.size() >= secondLen)
{
bool BoomCheck = true;
for (int j = 0; j < secondLen; j++)
{
if (Check[Check.size() - secondLen + j] != second[j])
{
BoomCheck = false;
break;
}
}
if (true == BoomCheck)
{
Check.erase(Check.end()-secondLen, Check.end());
}
}
}
if (true == Check.empty())
{
std::cout << "FRULA\n";
}
else
{
std::cout << Check<<"\n";
}
return 0;
}