题解 | #反序数#
反序数
https://www.nowcoder.com/practice/e0d06e79efa44785be5b2ec6e66ba898
#include <bits/stdc++.h>
using namespace std;
int main() {
for(int i =1000;i<=9999;i++){
int j = i*9;
string s1 = to_string(i),s2=to_string(j);
reverse(s2.begin(),s2.end());
if(s1==s2)cout<<i<<endl;
}
}
// 64 位输出请用 printf("%lld")
联想公司福利 1452人发布