Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int a, b, ans;
  5. int v[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  6.  
  7. int main() {
  8.     ios::sync_with_stdio(0);
  9.     cin.tie(0);
  10.     cout.tie(0);
  11.    
  12.     cin >> a >> b;
  13.     for(int i=a;i<=b;i++) for(char j : to_string(i)) ans += v[int(j -'0')];
  14.     cout << ans << endl;
  15.     return EXIT_SUCCESS;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement