把长的拼接起来,find即可
#include <bits/stdc++.h>
using namespace std;
int main() {
string a;
string b;
while(cin>>a>>b){
if(a.length()>b.length()){
cout<<"no"<<endl;
}
string res=b+b;
int len=b.length();
if(res.find(a)!=-1){
cout<<"yes"<<endl;
}else{
cout<<"no"<<endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发