Advertisement
dllbridge

Untitled

Oct 15th, 2022
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. long long a, b, c = -1, d;
  5.  
  6. int main()
  7. {
  8.  
  9.   cin >> a >> b;  
  10.  
  11.  for(int i = 0; i < 100000; i++)
  12.  {
  13.    
  14.       if(a == d){
  15.          
  16.           c++;
  17.           break;
  18.       }
  19.      
  20.      
  21.  
  22.       d = b % 10;
  23.      
  24.  }
  25.    
  26.   if(c == -1) cout << "No";
  27.  
  28.   else cout<<"Yes";
  29.        
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement