Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111869 | 唐安轩 | 31忽略大小写的字符串比较 | C++ | Compile Error | 0 MS | 0 KB | 522 | 2025-03-07 19:22:18 |
#include<iostream> #include<cstring> using namespace std; int main(){ string s1; string s2; getline(cin,s1); getline(cin,s2); int len =s1.size(); int len2 =s2.size(); for(int i=0;i<len;i++){ if(s1[i]>='A';s1[i]>='Z'){ s1[i]=s1[i]+32; } if(s2[i]>='A';s2[i]>='Z'){ s2[i]=s2[i]+32; } } if(s1<s2){ cout<<'<'; }else if(s1>s2){ cout<<'>'; }else{ cout<<'='; } return 0; }
Main.cc: In function 'int main()': Main.cc:12:22: error: expected ')' before ';' token if(s1[i]>='A';s1[i]>='Z'){ ^ Main.cc:12:33: error: expected ';' before ')' token if(s1[i]>='A';s1[i]>='Z'){ ^ Main.cc:12:28: warning: value computed is not used [-Wunused-value] if(s1[i]>='A';s1[i]>='Z'){ ^ Main.cc:15:22: error: expected ')' before ';' token if(s2[i]>='A';s2[i]>='Z'){ ^ Main.cc:15:33: error: expected ';' before ')' token if(s2[i]>='A';s2[i]>='Z'){ ^ Main.cc:15:28: warning: value computed is not used [-Wunused-value] if(s2[i]>='A';s2[i]>='Z'){ ^ Main.cc:10:9: warning: unused variable 'len2' [-Wunused-variable] int len2 =s2.size(); ^