fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int x, k;
  8. cin >> x >> k;
  9. if (x < 0) {
  10. x = -x;
  11. }
  12. for (int i = 1; i <= k; ++i) {
  13. int currNum;
  14. cin >> currNum;
  15. int cntEvenDigits = 0;
  16. while (currNum > 0) {
  17. if (currNum % 2 == 0) {
  18. ++cntEvenDigits;
  19. }
  20. currNum /= TEN;
  21. }
  22. if (cntEvenDigits == x) {
  23. cout << "DA\n";
  24. } else {
  25. cout << "NU\n";
  26. }
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5316KB
stdin
0 2
1 999999999
stdout
DA
DA