Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82497 石晋骁 31忽略大小写的字符串比较 C++ Accepted 1 MS 276 KB 525 2024-07-13 11:46:29

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string a; string b; int al,bl; getline(cin,a); getline(cin,b); al = a.size(); bl = b.size(); for(int i =0;i < al;i++){ if(a[i] >= 'A' && a[i] <= 'Z'){ a[i] = a[i]+32; } } for(int j =0;j < bl;j++){ if(b[j] >= 'A' && b[j] <= 'Z'){ b[j] = b[j]+32; } } if(a > b){ cout << ">"; return 0; }else if(a < b ){ cout << "<"; return 0; }else{ cout << "="; return 0; } return 0; }