题解 | #字符串字符匹配#
字符串字符匹配
https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
#include <bits/stdc++.h> using namespace std; int main() { string s, t; getline(cin, s); getline(cin, t); int judger = 0; int count = 0; for(int i=0; i<s.size(); i++){ judger = 0; for(int j=0; j<t.size(); j++){ if(s[i] == t[j]){ judger = 1; break;} } if(judger == 1){ count += 1;} //else {cout << "false" << endl; break;} } if(count == s.size()) cout << "true" << endl; else cout << "false" << endl; return 0; } // 64 位输出请用 printf("%lld")