题解 | #数字颠倒#

数字颠倒

https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe?tpId=37&tags=&title=&difficulty=0&judgeStatus=0&rp=1&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D2%26tpId%3D37%26type%3D37

/*
思路:
    直接以 string 形式获得输入的数据
    调用 reverse 函数对数据做翻转操作
*/

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

int main() {
    string str;
    cin >> str;

    reverse(str.begin(), str.end());
    cout << str << endl;

}
// 64 位输出请用 printf("%lld")

全部评论
秀儿
点赞 回复 分享
发布于 2024-10-09 11:12 未知

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务