string LeftRotateString(string str, int n) {
queue<char> q;
for(int i =0 ;i < str.size();i ++)
q.push(str[i]);
for(int i =0;i < n;i ++)
{
q.push(q.front());
q.pop();
}
string ret;
while(!q.empty())
{
ret += q.front();
q.pop();
}
return ret;
} 跟着感觉直接做的...草稿纸上验证的时候想到一句歌词...太快与你干什么叫莽撞.......好在过了(

京公网安备 11010502036488号