码迷,mamicode.com
首页 > 其他好文 > 详细

字符串-05. 字符串循环左移(20)

时间:2014-07-07 12:44:52      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   io   line   

 1 #include<iostream>
 2 #include<string>
 3 using namespace std;
 4 int main(){
 5     string s;
 6     int n;
 7     getline(cin,s);
 8     cin>>n;
 9     while(n--)
10         s=s.substr(1)+s[0];
11     cout<<s<<endl;
12     return 0;
13 }

 

字符串-05. 字符串循环左移(20),布布扣,bubuko.com

字符串-05. 字符串循环左移(20)

标签:style   blog   color   os   io   line   

原文地址:http://www.cnblogs.com/gnodidux/p/3820070.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!