文章

35

粉丝

0

获赞

144

访问

7.3k

头像
把长的拼接起来,find即可
P1727 中山大学机试题
发布于2025年3月20日 18:31
阅读数 152

#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;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发