题目:
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = “hello”, return “olleh”.
*********************我是分割线*************************
class Solution {
public:
string reverseString(string s) {
string p;
int n=s.size();
for(n=n-1;n>=0;n--)
{
p.push_back(s.at(n));
}
return p;
}
};