题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe?tpId=37&tqId=21234&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D1%26tpId%3D37%26type%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=&dayCountBigMember=30%E5%A4%A9&pageSource_var=%E6%9E%81%E9%80%9F%E5%88%A4%E9%A2%98%E9%98%9F%E5%88%97&userIdentity_var=%E9%9D%9E%E4%BC%9A%E5%91%98&topicName_var=%E5%8D%8E%E4%B8%BA%E6%9C%BA%E8%AF%95&topicID_var=37
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string str;
str =to_string(n); //将整数转化为字符串
int len =str.length();
for(int i =len -1;i >=0;i--){ //倒序输出
cout << str[i];
}
}
