Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
502 B
0
Indexable
Never
#include <iostream>

using namespace std;

int main()
{
    int a, b;
    int count = 0;
    cin >> a >> b;
    for (int i = a; i <= b; i++) {
        int count_d = 0;
        int j = i;
        int k = i;
        while (j > 0) {
            j /= 10;
            count_d += 1;
        }
        while (count_d > 2) {
            k /= 10;
            count_d -= 1;
        }
        if (k % 10 == (k / 10) % 10){
            count += 1;
        }
    }
    cout << count;
}