Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int n,x;
- scanf("%d%d",&n,&x);
- n--;
- for(;; n--) {
- int pomosenn=n;
- int validenbroj=1;
- while(pomosenn>0) {
- int pomosenx=x;
- while(pomosenx>0) {
- if(pomosenx%10==pomosenn%10)
- validenbroj=0;
- pomosenx/=10;
- }
- pomosenn/=10;
- }
- if(validenbroj) {
- printf("%d",n);
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement