You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
int n, m;
|
|
int cnt;
|
|
bool check(int x) {
|
|
while (x) {
|
|
int r = x % 10;
|
|
if (r % 2 == 0) return false;
|
|
x /= 10;
|
|
}
|
|
return true;
|
|
}
|
|
int main() {
|
|
cin >> n >> m;
|
|
for (int i = n; i <= m; i++)
|
|
if (check(i)) cnt++;
|
|
|
|
printf("%d\n", cnt);
|
|
return 0;
|
|
} |