JH11 题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
#include<iostream> #include<string> using namespace std; int main() { int n; cin >> n; string str1 = to_string(n); string str2; int len = str1.length(); for (int i = len - 1; i >= 0; i--) { str2 += str1[i]; } cout << str2; return 0; }
华为机试刷题实录 文章被收录于专栏
记录一下本科应届生(我自己)刷华为机试题的过程