#include <stdio.h>
#include<string.h>
int main()
{
char str[100];
int rotate = 0;
while(scanf("%s",str))
{
scanf("%d",&rotate);
char *p = str + rotate;
printf("%s",p);
*p = '\0';
printf("%s\n",str);
}
void Rotate(char str[], int n)
{
int len = strlen(str);
n = n % len;
for(int i = 0; i < n; ++i)
{
char c = str[i];
int j = 0;
for(j = i; j < len; j += n)
str[j] = str[j+n];
str[j-n] = c;
}
}
大家帮我看下这个怎么才能改对呢?那个函数要怎么理解呢?在主函数中并没有被调用啊,可以这样用吗?