#include<iostream>
using namespace std;
bool test01(string str1, string str2)
{
if (str1.size() != str2.size())
{
return false;
}
for (int i = 0; i < str1.size(); i++)
{
bool a = 0;
for (int j = 0; j < str2.size(); j++)
{
if (str1[i] == str2[j])
{
a = 1;
}
}
if (!a)
{
return 0;
}
}
return 1;
}
int main()
{
string str1;
string str2;
cout << "请输入第一个字符串" << endl;
cin >> str1;
cout << "请输入第二个字符串" << endl;
cin >> str2;
bool outcome = test01(str1, str2);
if (outcome)
{
cout << "两个字符串可能相等" << endl;
}
else
{
cout << "两个字符串不相等" << endl;
}
system("pause");
return 0;
}