Advertisement
STANAANDREY

pb47

Jan 16th, 2019
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.  
  8.  unsigned long a,b,ok=0,cb,uc;//
  9.  
  10.  cout<<"a=";cin>>a;
  11.  cout<<"b=";cin>>b;
  12.  cb=b;
  13.  
  14.   while (a&&!ok)
  15.   {
  16.       uc=a%10; cb=b;
  17.       while (!ok&&cb) {
  18.       if (uc==cb%10)
  19.         ok=1;
  20.         cb/=10;
  21.       }
  22.       a/=10;
  23.   }
  24.  
  25.  if (ok)
  26.     cout<<"DA";
  27.  else
  28.     cout<<"NU";
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement