请定义一个函数实现字符串左旋转操作的功能。
例如输入字符串“qwertyu”和数字2,该函数将返回左旋转两位得到的结果“ertyuqw”
#include<string.h>
#include<stdio.h>
int main()
{
int n,j,i;
char str[100];
printf("请输入字符串\n");
scanf("%s",&str);
printf("请输入数字\n");
scanf("%d",&n);
i = strlen(str);
for(j = n; j < i ; j++)
{
printf("%c",str[j]);
}
for( j = 0 ; j < n ; j++ )
{
printf("%c",str[j]);
}
return 0;
}