//判断一个字符串是否是一个字符串的旋转字符串  
//利用库函数实现
#include <stdio.h>
#include <string.h>
#include <assert.h>
int IsRotate(char *str1, const char *str2)
{
assert(str1);
assert(str2);
strncat(str1, str1,strlen(str1));
if (NULL == strstr(str1, str2))
return 0;
else
return 1;
}
int main()
{
char str1[20] = "abcdef";
char str2[] = "efabcd";
printf("%d\n", IsRotate(str1, str2));
return 0;
}