题目描述
将其全部换成小写即可达到忽略大小写比较字符串的效果。
样例
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string a,b;
getline(cin,a);
getline(cin,b);
int i;
for (int i = 0; i < a.size(); i ++)
{
if (a[i] >= 'A' && a[i] <= 'Z')
a[i] += 32;
}
for (int i = 0; i < b.size(); i ++)
{
if (b[i] >= 'A' && b[i] <= 'Z')
b[i] += 32;
}
if(a<b) cout<<"<";
else if(a>b) cout<<">";
else cout<<"=";
return 0;
}