标签:
void leftRoutate(std::string& s, size_t offset)
{
auto reverse = [&](size_t begin, size_t end)
{
--end;
while (begin <= end){
std::swap(s[begin], s[end]);
++begin;
--end;
}
};
reverse(0, offset);
reverse(offset, s.length ());
reverse(0, s.length ());
}
标签:
原文地址:http://www.cnblogs.com/wuOverflow/p/5143935.html