题解 | 数字颠倒

数字颠倒

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; // 输出答案

}

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

全部评论

相关推荐

愤怒的潜伏者在开会:你不攻击他,我可攻击你了
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客企业服务