void Reverse(char *s,int L,int H){
while(L<H){
swap(s[L],s[H]);
L++, H--;
}
}
void ShiftI(char *s, int n, int i){
// abc1234->cba4321->1234abc
Reverse(s,0,i-1);
Reverse(s,i,n-1);
Reverse(s,0,n-1);
}
void Reverse(char *s,int L,int H){
while(L<H){
swap(s[L],s[H]);
L++, H--;
}
}
void ShiftI(char *s, int n, int i){
// abc1234->cba4321->1234abc
Reverse(s,0,i-1);
Reverse(s,i,n-1);
Reverse(s,0,n-1);
}
1707

被折叠的 条评论
为什么被折叠?