Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3420 邓小龙 31忽略大小写的字符串比较 C++ Wrong Answer 0 MS 260 KB 460 2024-06-07 17:00:57

Tests(0/10):


Code:

# include<iostream> # include<cstring> using namespace std; string s1,s2; void fun(string &s){//全转成大写 int lens=s.size(); for(int i=0;i<lens;i++) if(s[i]>='a'&&s[i]<='z') s[i]=s[i]-32; } int main(){ getline(cin,s1); getline(cin,s2); fun(s1); fun(s2); cout<<s1<<endl<<s2<<endl; if(s1==s2)cout<<"="<<endl; if(s1>s2)cout<<">"<<endl; if(s1<s2)cout<<"<"<<endl; return 0; }


Run Info:

------Input------
hello world Hello world
------Answer-----
=
------Your output-----
HELLO WORLD HELLO WORLD =