标签:
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 ans=""; int n=s.length(); for(int i=n-1;i>=0;i--){ ans+=s[i]; } return ans; } };
标签:
原文地址:http://www.cnblogs.com/zywscq/p/5423564.html