reverse 字符串翻转

头文件

algorithm

1   string s="hello";
2     reverse(s.begin(),s.end());
3     char c[]="hello";
4     reverse(c,c+strlen(c));

这个函数只要有区间就可以了。

很简单的。

原文地址:https://www.cnblogs.com/zhmlzhml/p/12468922.html