Advertisement
erfanul007

CF 2019 A

Jan 4th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string x,a;
  7. cin>>x;
  8. int i,cnt=0;
  9. for(i=0;i<5;i++){
  10. cin>>a;
  11. if(a[0]==x[0] || a[1]==x[1])
  12. cnt++;
  13. }
  14. if(cnt==0)
  15. cout<<"NO"<<endl;
  16. else
  17. cout<<"YES"<<endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement