标签:cout pen ace back public name read namespace tor
#include<stdio.h> #include<string.h> #include <pthread.h> #include <iostream> #include <algorithm> #include <vector> #include <stack> #include <stdlib.h> #include <sstream> using namespace std; class Solution { public: string LeftRotateString(string str, int n) { int length=str.length(); cout<<length<<endl; if(n>length) return str; else { string front=str.substr(0,n); string back=str.substr(n); back.append(front); return back; } } }; int main() { Solution s; string str="XYZabdfg"; cout<<s.LeftRotateString(str,10)<<endl; system("pause"); return 0; }
标签:cout pen ace back public name read namespace tor
原文地址:http://www.cnblogs.com/bananaa/p/7575582.html