斜体内容
反转字符串,可以直接调用库函数reverse(),也可以从后面遍历输出
下面给是reverse的AC代码:
class Solution {
public:
/**
* 反转字符串
* @param str string字符串
* @return string字符串
*/
string solve(string str) {
// write code here
reverse(str.begin(),str.end());
return str;
}
};


京公网安备 11010502036488号