第一题CPP写的,AC,感觉就第一题最简单 #include<iostream> #include<string> #include<map> #include<algorithm> using namespace std; int main() { int num = 0; cin >> num; map<int, int> reverseMap; int counts = 0; for (int i = 1; i <= num/4; i++) { string str1 = to_string(i * 4); string str2 = to_string(i); reverse(str1.begin(), str1.end()); if (str1 == str2) { counts++; reverseMap.insert(make_pair(i, i * 4)); } } cout << counts << endl; for (auto e : reverseMap) { cout << e.first << ' &(5528)#39; << e.second << endl; } system("pause"); return 0; }