函数调用法
tolower()
将字母转为小写
然后再进行比较
AC代码
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s1,s2;
getline(cin,s1);
getline(cin,s2);
for(int i = 0; i < s1.size(); i ++ )
{
s1[i] = tolower(s1[i]);
}
for(int i = 0; i < s2.size(); i ++ )
{
s2[i] = tolower(s2[i]);
}
if(s1 == s2) puts("=");
else if(s1 > s2) puts(">");
else puts("<");
return 0;
}
建议前面换成