#include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main()
{
string a, b;
getline(cin, a);
getline(cin, b);
// &c,传递地址,改变源字符串
for (auto &c : a) c = tolower(c); // c = toupper(c);
for (auto &c : b) c = tolower(c); // c = toupper(c);
if (a > b) cout << '>' << endl;
else if (a < b) cout << '<' << endl;
else cout << '=' << endl;
return 0;
}
忽略大小写比较字符串大小(tolower/toupper)C++
于 2023-11-20 20:08:11 首次发布