标签:
Description
Input
Output
Sample Input
Sample Output
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <cstring>
using namespace std;
#define INF 0xfffffff
#define maxn 120000
bool Slove(char s1[],char s2[])
{
char s3[maxn];
if( strlen(s1) < strlen(s2) )
return false;
strcpy(s3,s1);
strcat(s3,s1);
return strstr(s3,s2);
}
int main()
{
char s1[maxn], s2[maxn];
while(cin >> s1)
{
cin >> s2;
if( Slove(s1,s2) )
cout << "yes" << endl;
else
cout << "no" <<endl;
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/yishilin/p/4237222.html