#define _CRT_SECURE_NO_WARNINGS 1#include<stdio.h> #include <string.h>void Reserve (Char *left, char*right) {while (left < right) {char tmp = * left;*left = *right;*right = tmp;left++;right--;}} Void left_reserve (char arr[], int k) {Int len = strlen (arr) - 1; Char *pstart = &arr[0];char *pend = arr + len;reserve (Pstart, pstart + k - 1); reserve (Pstart + k, pend); reserve (Pstart, pend);} Void right_reserve (char arr[], int k) {Int len = strlen (arr) - 1; Char *pstart = &arr[0];char *pend = arr + len;reserve (Pstart, pstart + len - k); reserve (Pend - k+1, pend); Reserve (Pstart, pend );} Int main () {char arr[10] = "AABCD"; char arr2[10] = "ABCDA";char *p = arr;int k = 5;while (k) {Left_reserve ( arr, k);if (strcmp (ARR,&NBSP;ARR2) == 0) {printf ("1\n"); Right_reserve (p, k);if (strcmp (P,&NBSP;ARR2) == 0) {printf ("1\n"); k--;} if (0 == k) {printf ("0\n");} System ("Pause");}
"C" "pen question" "Face question" judge whether a string is a string after the rotation of another string