编写一个函数,其作用是将输入的字符串反转过来。
class Solution {
public:
string reverseString(
string s) {
int len =
s.size();
string result;
for(
int n =
0; n < len; n++
)
{
result.append(1,s.at(len -
1 -
n));
}
return result;
}
};
转载于:https://www.cnblogs.com/qian-lu/p/9703667.html
相关资源:TSC_TE344.rar
转载请注明原文地址: https://win8.8miu.com/read-26190.html