a53

Identice4

a53
Jan 7th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. bool cifre(int numar)
  2. {
  3. int c=numar%10;
  4. while(numar)
  5. {
  6. if(numar%10==c)
  7. numar/=10;
  8. else
  9. break;
  10. }
  11. return (numar==0);
  12. }
  13.  
  14.  
  15. void identice(int a,int b)
  16. {
  17. bool ok=false;
  18. for(int i=a;i<=b;++i)
  19. if(cifre(i))
  20. ok=true,cout<<i<<' ';
  21. if(!ok)
  22. cout<<"nu exista";
  23. }
Add Comment
Please, Sign In to add comment