代码如下:
#include <vector>
#include <iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int flag = 0;
string a, b;
cin >> a >> b;
if (a.size() == b.size())//字符串大小相等
{
if (!a.compare(b))//字符串相等a==b
{
flag = 2;
}
else
{
transform(a.begin(), a.end(),a.begin(), toupper);
transform(b.begin(), b.end(), b.begin(), toupper);
if (a == b)//不区分大小写相等
{
flag = 3;
}
else
{
flag = 4;
}
}
}
else
{
flag = 1;
}
cout << flag << endl;
system("pause");
return 0;
}