题解 | #字符串字符匹配#
字符串字符匹配
https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
- 再来个C++版本,防止python3到时候搞不定
#include <iostream> #include <set> using namespace std; int main() { string s, t; bool flag; while (cin >> s >> t) { // 注意 while 处理多个 case set<char> set; for (char ch : t) { set.insert(ch); } flag = true; for (char ch : s) { if (!set.count(ch)) { flag = false; break; } } if (flag) { cout << "true" << endl; } else { cout << "false" << endl; } } return 0; } // 64 位输出请用 printf("%lld")