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

字符串字符匹配

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

#include <iostream>
using namespace std;
int main()
{
    string a,b;
    while(getline(cin,b),getline(cin,a))
    {
        int c=0;
        for(int i=0;i<b.length();i++)
        {
           for(int j=0;j<a.length();j++)
           {
               if(b[i]==a[j])
               {
                   c++;
                   break;
               }
           } 
        }
     if(c==b.length())
     {
         cout<<"true";
     }
        else
        {
            cout<<"false";
        }
    }
    return(0);
}
全部评论

相关推荐

程序员牛肉:这一眼假啊,基本上都是骗人的,不然就涉及到职位贪腐了,就像之前华为的OD事件,看你运气好不好了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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