队列模拟
左旋转字符串
http://www.nowcoder.com/questionTerminal/12d959b108cb42b1ab72cef4d36af5ec
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; }
跟着感觉直接做的...草稿纸上验证的时候想到一句歌词...太快与你干什么叫莽撞.......好在过了(