0
点赞
收藏
分享

微信扫一扫

NC103 反转字符串

NC103 反转字符串_c1
描述
写出一个程序,接受一个字符串,然后输出该字符串反转后的字符串。(字符串长度不超过1000)
NC103 反转字符串_字符串_02
示例1

输入:
"abcd"
返回值:
"dcba"

code:

class Solution {
public:
/**
* 反转字符串
* @param str string字符串
* @return string字符串
*/
string solve(string str) {
// write code here
reverse(str.begin(),str.end());
return str;
}
};


举报

相关推荐

0 条评论