热门

最新

红包

立Flag

投票

同城

我的

发布
2303_79299383
EvLast
3 年前
true2303_79299383

-旋转词
#include<bits/stdc++.h>
using namespace std;

int main(){
int a,b,count=0;
string c,d;
cin >> a >> b;
cin >> c;
cin >> d;
if(a!=b){
cout << "No";
}else{
string str= c+c;
for(int i=0;i<a;i++){
string str2 = str.substr(i,a);
if(str2==d){
cout<<"YES";//为什么这个明明赋值为一可是并没有等于一
}else{
count++;
}
}
if(count!=0){
cout << "No";
}
}
return 0;
}
//这个明明count++了为什么跳出if还是变成0最后还是会执行
if(count!=0){
cout << "No";
}

保持热爱共赴山海
CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条动态
立即登录