左旋转字符串
根据 http://blog.csdn.net/v_JULY_v/article/details/6322882 敲的。
//main函数开始 main(){ char str[] = "123456"; move(str, 6, 4); printf("%s \n", str); } move(char str[], int length, int x){ fanZhuan(str, 0, length - x - 1); fanZhuan(str, length - x, length - 1); fanZhuan(str, 0, length - 1); } fanZhuan(char str[], int b, int e){ char temp; for(; b < e; b++, e--){ temp = str[b]; str[b] = str[e]; str[e] = temp; } }