| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70143 | 游四鑫 | 31忽略大小写的字符串比较 | C++ | Compile Error | 0 MS | 0 KB | 388 | 2024-04-13 17:25:19 |
#include<iostream> using namespace std; int main(){ string a,b; getline(cin,a); getline(cin,b); for(int i=0;i<=a.size();i++){ if(a[i]>="a"&&a[i]<="z")a[i]=a[i]-32; } for(int i=0;i<=b.size();i++){ if(b[i]>="a"&&b[i]<="z")b[i]=b[i]-32; } if(a>b){ cout<<">"; } else if(a<b){ cout<<"<"; } else{ cout<<"="; } return 0; }
Main.cc: In function 'int main()':
Main.cc:8:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<=a.size();i++){
^
Main.cc:9:13: warning: comparison with string literal results in unspecified behaviour [-Waddress]
if(a[i]>="a"&&a[i]<="z")a[i]=a[i]-32;
^
Main.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:9:24: warning: comparison with string literal results in unspecified behaviour [-Waddress]
if(a[i]>="a"&&a[i]<="z")a[i]=a[i]-32;
^
Main.cc:9:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:13:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<=b.size();i++){
^
Main.cc:14:13: warning: comparison with string literal results in unspecified behaviour [-Waddress]
if(b[i]>="a"&&b[i]<="z")b[i]=b[i]-32;
^
Main.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:14:24: warning: comparison with string literal results in unspecified behaviour [-Waddress]
if(b[i]>="a"&&b[i]<="z")b[i]=b[i]-32;
^
Main.cc:14:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]