#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
ifstream cin("d:\\OJ\\uva_in.txt");
#endif
for (int i = 1000; i < 10000; i++) {
int j = i * 9;
if (j > 10000) break;
stringstream ss;
string s1, s2;
ss << i << " " << j;
ss >> s1 >> s2;
//cout << "s1:" << s1 << " s2:" << s2 << endl;
reverse(s2.begin(), s2.end());
if (s1 == s2) cout << i << endl;
}
return 0;
}
题目1064:反序数
最新推荐文章于 2022-12-27 20:51:03 发布