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

字符串字符匹配

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

15行秒杀,我知道它不快,但是它短呀。。。
#include <bits/stdc++.h>
using namespace std;

int main(){
    string s, t;
    cin>> s>> t;
    bool flag= true;
    for(int i= 0; i< s.length(); ++i)
        if(t.find(s[i])== -1)
            flag = false;
    if(flag)
        cout<< "true";
    else
        cout<< "false";
}


全部评论

相关推荐

榕城小榕树:1200单休,我去干点啥别的不好
点赞 评论 收藏
分享
06-23 11:28
门头沟学院 Java
牛客91966197...:也有可能是点拒绝的时候自动弹的话术
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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