题解 | 数字颠倒

数字颠倒

https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe

#include<bits/stdc++.h>// 万能头

#include <string>

using namespace std;

int main()

{

    int n;

    string s; // 定义

    cin>>s;// 字符串输入

    reverse(s.begin(),s.end());// 用头文件algorithm的内置函数将其倒置

    cout<<s; // 输出答案

}

活动地址: 牛客春招刷题训练营 - 编程打卡活动

全部评论

相关推荐

09-17 10:53
四川大学 C++
牛客91242815...:会写标书没有任何卵用,鉴定为横向垃圾导师的受害者
点赞 评论 收藏
分享
10-10 16:30
济宁学院 Java
一表renzha:面试官:蓝桥杯三等奖?你多去两次厕所都能拿二等吧
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

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