fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b;
  6. cin >> a>> b;
  7. while (b > 10) {
  8. b /= 10;
  9. }
  10.  
  11. if (b == a % 10 || b == a / 10 % 10) {
  12. cout << "DA";
  13.  
  14. } else {
  15. cout << "NU";
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5288KB
stdin
2 3356
stdout
NU