翻转字符串,也即:abcd
⇒ dcba
void ReverseString(char* s, int from, int to)
{
while(from < to)
{
char t = s[from];
s[from++] = s[to];
a[to--] = t;
}
}
翻转字符串,也即:abcd
⇒ dcba
void ReverseString(char* s, int from, int to)
{
while(from < to)
{
char t = s[from];
s[from++] = s[to];
a[to--] = t;
}
}