标签:
1 class Reverse { 2 public: 3 string reverseString(string iniString) { 4 // write code here 5 string::iterator b=iniString.begin(); 6 string::iterator e=iniString.end(); 7 e--; 8 while(b<e) 9 { 10 swap(*b++,*e--); 11 } 12 return iniString; 13 } 14 };
标签:
原文地址:http://www.cnblogs.com/hslzju/p/5699533.html