双指针
2025-01-26 18:03:23
发布于:广东
4阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int x,y;
char f(char c){
if(c>='a'&&c<='z')return char(c-32);
return c;
}
int main(){
string a,b;
getline(cin,a);
getline(cin,b);
while(x<a.size()&&y<b.size()){
if(a[x]==' ')x++;
else if(b[y]==' ')y++;
else if(f(a[x])!=f(b[y])){
cout << "NO";
return 0;
}else x++,y++;
}cout << "YES";
return 0;
}
这里空空如也
有帮助,赞一个