1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 void left_rotate(char *str, int k) 6 { 7 int len=strlen(str); 8 k %= len;//减少重复次数 9 10 char temp = 0; 11 char *cur = str; 12 while (k--) 13 { 14 15 //左旋一次 16 temp = *str; 17 cur = str; 18 while (*(cur + 1) != '