//字符串匹配
#include <iostream>
#include <string>
using namespace std;
int main()
{
string pshort, plong;
cin >> pshort;
cin >> plong;
int flag,i,j;
for ( i = 0; i < pshort.size(); i++)
{
flag = 0;
for (j = 0; j < plong.size();j++)
{
if (pshort[i]==plong[j])
{
flag = 1;
}
}
if (flag == 0) break;
}
if (flag == 1) cout << "true" << endl;
else cout << "false" << endl;
return 0;
}
华为OJ题目(十六):字符串匹配
最新推荐文章于 2023-03-18 18:29:56 发布