Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,b,n,c,i,k;
  8.  
  9. cin>>a;
  10. cin>>b;
  11.  
  12. k=0;
  13.  
  14. for(i=a;i<=b;i++)
  15. {
  16. n=i;
  17. c=0;
  18. while(n>0)
  19. {
  20. if(n%2==1)
  21. c=c+1;
  22. n=n/10;
  23. }
  24. if(c>0)
  25. k=k+1;
  26. }
  27. cout<<k;
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement