Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82532 石依灵 31忽略大小写的字符串比较 C++ Compile Error 0 MS 0 KB 799 2024-07-13 11:56:55

Tests(0/0):


Code:

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


Run Info:

Main.cc:1:25: warning: extra tokens at end of #include directive
 #include using namespace std; int main() { 
                         ^
Main.cc:2:1: error: 'string' does not name a type
 string s1,s2; 
 ^
Main.cc:3:8: error: expected constructor, destructor, or type conversion before '(' token
 getline(cin,s1); 
        ^
Main.cc:4:8: error: expected constructor, destructor, or type conversion before '(' token
 getline(cin,s2); 
        ^
Main.cc:5:1: error: expected unqualified-id before 'for'
 for(int i=0; is2){
             ^
Main.cc:35:1: error: expected unqualified-id before 'return'
 return 0; }
 ^
Main.cc:35:11: error: expected declaration before '}' token
 return 0; }
           ^