提交时间:2024-05-04 09:12:10

运行 ID: 46454

#include <bits/stdc++.h> using namespace std; int sum[10001]; int main(){ int n; cin >> n; for(int i = 1; i <= n; i++){ int k = i; while(k){ sum[i] += k % 10; k /= 10; } } for(int i = 1; i <= n; i++){ if(sum[i] % 2 == 0){ cout << i << " "; } } return 0; }