题目链接:​​传送门​

貌似可以数位dp
但​​​这种思路​​还是很不错的

/**
* @Date: 2019-04-01T14:41:49+08:00
* @Last modified time: 2019-04-01T14:41:49+08:00
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <complex>
#include <algorithm>
#include <climits>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define
#define

using namespace std;
typedef long long ll;
ll calc(ll l) {
ll r = 0, ans = 1, w = 1;
while (l >= 10) {
ll m = l % 10;
l /= 10;
if (m) ans += l * w;
else ans += (l - 1) * w + r + 1;
r += m * w;
w *= 10;
}
return ans;
}
ll a, b;

int main(int argc, char const *argv[]) {
while (cin >> a >> b and ~a and ~b) cout << calc(b) - calc(a - 1) << endl;
}