//we have defined the necessary header files here for this problem.
//If additional header files are needed in your program, please import here.
#include<iostream>
#include<string>
string compress(string a){
string b;
for(int i=0;i<a.size();i++){
if(a[i]!=' ')
b.push_back(a[i]);
}
return b;
}
bool compare(string a,string b){
if(a.size()!=b.size()){
return false;
}
for(int i=0;i<a.size();i++){
if(a[i]!=b[i]){
if(abs(a[i]-b[i])!=32)
return false;
}
}
return true;
}
int main(){
string a,b;
while(getline(cin,a)&&getline(cin,b)){
a=compress(a);
b=compress(b);
bool f=compare(a,b);
if(f==true)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}
一次读入两行字符串
猜你喜欢
转载自blog.csdn.net/qq_29230349/article/details/104449504
今日推荐
周排行