Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129235 罗安博 31忽略大小写的字符串比较 C++ Compile Error 0 MS 0 KB 370 2025-08-23 09:58:07

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:17:8: error: could not convert 'a.std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=, std::allocator >(b)' from 'std::__cxx11::basic_string' to 'bool'
  if(a=b){
        ^
Main.cc:8:6: warning: unused variable 'm' [-Wunused-variable]
  int m=0 ,t=0;
      ^
Main.cc:8:11: warning: unused variable 't' [-Wunused-variable]
  int m=0 ,t=0;
           ^