题解 | #反序输出#

反序输出

https://www.nowcoder.com/practice/171278d170c64d998ab342b3b40171bb

#include <bits/stdc++.h>
using namespace std;

int main(){
    string a;
    while(cin >> a){
        for(int i = a.length()-1;i>=0;i--){
            cout << a[i] ;
        }
        cout << endl;
    }
}

做这题有点浪费时间了,主要是注意length()-1

全部评论

相关推荐

04-13 20:21
门头沟学院 Java
点赞 评论 收藏
分享
03-12 15:35
嘉应学院 Python
快说谢谢牛牛精灵:说不定就是下一个寒武纪!
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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