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

字符串字符匹配

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;
}
全部评论

相关推荐

10-12 14:15
客户端其它
欢乐喵喵狗:幽默美团查看图片
点赞 评论 收藏
分享
循此苦旅:月初笔试全a,没面试!
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务