21 lines
360 B
C++
21 lines
360 B
C++
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
bool check(int x) {
|
|
int sum = 0;
|
|
while (x) {
|
|
int a = x % 10;
|
|
x /= 10;
|
|
sum += a;
|
|
}
|
|
return sum % 2 == 0;
|
|
}
|
|
|
|
int main() {
|
|
int n, m;
|
|
cin >> n >> m;
|
|
for (int i = n; i <= m; i++)
|
|
if (check(i))
|
|
cout << i << endl;
|
|
return 0;
|
|
} |