123-wind

题目链接:点这里


题目描述:
输入任意4个字符(如:abcd), 并按反序输出(如:dcba)


思路:
字符串逆序输出


代码:

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

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

分类:

技术点:

相关文章: