Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
110296 陈铎文 输出回文数 C++ Accepted 36 MS 276 KB 428 2025-02-16 09:08:29

Tests(10/10):


Code:

#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int reversed_num = 0; int temp = i; while (temp > 0) { reversed_num = reversed_num * 10 + (temp % 10); temp /= 10; } if (reversed_num == i) { cout << i << endl; } } return 0; }