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

字符串字符匹配

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

#include <bits/stdc++.h>
using namespace std;

int main(){
    string s1,s2;
    
    while(getline(cin, s1)&&getline(cin, s2)){
        string s="true";
        for(int i=0;i<s1.size();++i){
            if(count(s2.begin(),s2.end(), s1[i])==0){
                s="false";
                break;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}
全部评论

相关推荐

09-24 18:30
已编辑
长春工业大学 产品经理
小肥罗:HR就是好人的缩写哈哈哈哈
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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