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.
23 lines
504 B
23 lines
504 B
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
int cnt;
|
|
bool check(int x) {
|
|
string s = to_string(x);
|
|
string t = s;
|
|
reverse(t.begin(), t.end());
|
|
|
|
if (s != t) return false;
|
|
bool flag = false;
|
|
for (int i = 0; i < s.size(); i++)
|
|
if (s[i] == '7') flag = true;
|
|
if (!flag) return false;
|
|
return true;
|
|
}
|
|
int main() {
|
|
int a, b;
|
|
cin >> a >> b;
|
|
for (int i = a; i <= b; i++)
|
|
if (check(i)) cnt++;
|
|
cout << cnt << endl;
|
|
return 0;
|
|
} |