提交时间:2024-02-06 22:34:10
运行 ID: 40049
#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 s3 = change(s1); string s4 = change(s2); //比较 if(s3 > s4) cout << ">"; else if(s3 == s4) cout <<"="; else if(s3 < s4) cout << "<"; return 0; }