Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44205 | 张淳睿 | 忽略大小写的字符串比较 | C++ | Accepted | 1 MS | 248 KB | 424 | 2024-03-29 15:21:44 |
#include<iostream> #include<cstring> using namespace std; char a[81],b[81]; int main() { gets(a); gets(b); for(int i=0;i<strlen(a);i++){ if('a'<=a[i]&&a[i]<='z'){ a[i]+=('A'-'a'); } } for(int i=0;i<strlen(b);i++){ if('a'<=b[i]&&b[i]<='z'){ b[i]+=('A'-'a'); } } int c=strcmp(a,b); if(c==0){ cout<<"="; } else if(c==1){ cout<<">"; } else{ cout<<"<"; } return 0; }