Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152068 唐诗阳 31忽略大小写的字符串比较 C++ Compile Error 0 MS 0 KB 697 2026-04-19 15:17:10

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string a,b; getline(cin,a); getline(cin,b); for(int i=1;i<=a.strlen();i++){ if(a[i]>='A' && a[i]<='Z'){ a[i]+='a'-'A'; } } for(int i=1;i<=b.strlen();i++){ if(a[i]>='A' && a[i]<='Z'){ a[i]+='a'-'A'; } } if(a>b){ cout<<'>'; } else if(a==b{ cout<<'='; } else if(a<b{ cout<<'<'; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:22: error: 'std::__cxx11::string {aka class std::__cxx11::basic_string}' has no member named 'strlen'
     for(int i=1;i<=a.strlen();i++){
                      ^
Main.cc:15:22: error: 'std::__cxx11::string {aka class std::__cxx11::basic_string}' has no member named 'strlen'
     for(int i=1;i<=b.strlen();i++){
                      ^
Main.cc:23:17: error: expected ')' before '{' token
     else if(a==b{
                 ^