Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
78224 sh25_wanghy 忽略大小写的字符串比较 C++ 通过 0 MS 248 KB 511 2025-12-26 15:29:24

Tests(1/1):


#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string str1, str2; getline(cin, str1); getline(cin, str2); // 转换为小写并比较 transform(str1.begin(), str1.end(), str1.begin(), ::tolower); transform(str2.begin(), str2.end(), str2.begin(), ::tolower); if (str1 < str2) { cout << "<"; } else if (str1 > str2) { cout << ">"; } else { cout << "="; } return 0; }


测评信息: