Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n,x;
  5. scanf("%d%d",&n,&x);
  6.  
  7. n--;
  8.  
  9. for(;; n--) {
  10. int pomosenn=n;
  11. int validenbroj=1;
  12.  
  13. while(pomosenn>0) {
  14. int pomosenx=x;
  15. while(pomosenx>0) {
  16. if(pomosenx%10==pomosenn%10)
  17. validenbroj=0;
  18. pomosenx/=10;
  19. }
  20. pomosenn/=10;
  21. }
  22.  
  23. if(validenbroj) {
  24. printf("%d",n);
  25. return 0;
  26. }
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement