头文件
algorithm
1 string s="hello"; 2 reverse(s.begin(),s.end()); 3 char c[]="hello"; 4 reverse(c,c+strlen(c));
这个函数只要有区间就可以了。
很简单的。