题解 | #字符逆序#

字符逆序

http://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b

#include<iostream>
#include<stack>
using namespace std;
int main()
{
    string str;
    while(getline(cin,str))
    {
        string res;
        int i=str.length()-1;
        while(i>=0)
        {
            res.push_back(str[i--]);
        }
        cout<<res<<endl;
    }
    return 0;
}
全部评论

相关推荐

点赞 评论 收藏
分享
重生我想学测开:嵌入式的问题,我准备入行京东外卖了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务