华为机试:字符串反转

#include <iostream>
#include <iterator>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    // int a, b;
    // while (cin >> a >> b) { // 注意 while 处理多个 case
    //     cout << a + b << endl;
    // }
    string str;
    cin >> str;
    reverse(str.begin(), str.end());
    cout << str << endl;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 15:27
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

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