题解 | #字符串字符匹配#

字符串字符匹配

https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    string s1,s2;
    getline(cin, s1);
    getline(cin, s2);
    for(auto ch:s1){
        if(s2.find(ch)==string::npos){
            cout << "false"<<endl;
            return 0;
        }
    }
    cout <<"true"<<endl;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

2025-11-26 09:37
山西大学 测试工程师
累死的一条狗:学长你电脑闹鬼了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务