提交时间:2024-02-06 22:35:38
运行 ID: 40050
#include<iostream> #include<string> using namespace std; string change(string s) {//大小写转换 for (int i = 0; s[i] != '\0'; i++) { if(s[i] >= 'A' && s[i] <= 'Z') { //遇到大写字母转换为小写字母 s[i] = s[i] + 32; } } return s; } int main() { string s1, s2; getline(cin, s1); getline(cin, s2); string s1 = change(s1); string s2 = change(s2); //比较 if(s1 > s2) cout << ">"; else if(s1 == s2) cout <<"="; else if(s1 < s2) cout << "<"; return 0; }