帮忙检查一下有没有编译错误
#include<bits/stdc++.h>using namespace std;
int main() {
string s,s2;
getline(cin,s);
getline(cin,s2);
while(s.find(' ')!=string::npos){
s.erase(s.find(' '),1);
}
while(s2.find(' ')!=string::npos){
s2.erase(s2.find(' '),1);
}
cout<<s<<endl<<s2<<endl;
for(int i=0; i<s.size(); i++) {
s[i]=toupper(s[i]);
}
for(int i=0; i<s2.size(); i++) {
s2[i]=toupper(s2[i]);
}
if(s==s2&&s.size()==s2.size()){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}