SHARE
TWEET

E

namemkazaza May 25th, 2020 1,045 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. long check(long k) {
  5.     long s = 0;
  6.     while (k) {
  7.         s += k % 10;
  8.         k /= 10;
  9.     }
  10.     return s;
  11. }
  12.  
  13. int main() {
  14.     long a, b;
  15.     long n = 0;
  16.     cin >> a >> b;
  17.     for (long i = a; i <= b; i++) {
  18.         if (check(i) % 2 != 0)
  19.             n++;
  20.     }
  21.     cout << n;
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top