leetcode之371. Sum of Two Integers(C++解法)

題目:
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;
}

};

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章