25 lines
575 B
C++
25 lines
575 B
C++
#include <iostream>
|
|
#include <regex>
|
|
#include <string>
|
|
using namespace std;
|
|
int main() {
|
|
std::string s, t;
|
|
while (std::cin >> s >> t) {
|
|
std::string pattern;
|
|
for (char c : s) {
|
|
pattern += std::regex_escape(std::string(1, c)) + ".*";
|
|
}
|
|
// È¥µô×îºó¶àÓàµÄ .*
|
|
if (!pattern.empty()) pattern = pattern.substr(0, pattern.size() - 2);
|
|
|
|
std::regex re(pattern);
|
|
if (std::regex_match(t, re)) {
|
|
std::cout << "Yes\n";
|
|
} else {
|
|
std::cout << "No\n";
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|