题解 | 数字颠倒
数字颠倒
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; // 输出答案
}
活动地址: 牛客春招刷题训练营 - 编程打卡活动