Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int a, b, ans, k, j;
- int v[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
- int pot[] = {1, 10, 100, 1000, 10000, 100000, 1000000};
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- cin >> a >> b;
- for(int i=a;i<=b;i++) {
- k = 6, j=i;
- while(k>0 && pot[k] > i) --k;
- for(;k>=0;k--) {
- ans += v[int(j / pot[k])];
- j %= pot[k];
- }
- }
- cout << ans << endl;
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement