Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- unsigned long a,b,ok=0,cb,uc;//
- cout<<"a=";cin>>a;
- cout<<"b=";cin>>b;
- cb=b;
- while (a&&!ok)
- {
- uc=a%10; cb=b;
- while (!ok&&cb) {
- if (uc==cb%10)
- ok=1;
- cb/=10;
- }
- a/=10;
- }
- if (ok)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement