题目描述:
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) {
int i=0;
int j=s.size()-1;
while(i<=j)
{
char temp=s[i];
s[i]=s[j];
s[j]=temp;
i++;
j--;
}
return s;
}
};