fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int a, b, c, x, countNoDigit = 1;
  8. cin >> a >> b >> c >> x;
  9. int firstDigit = x;
  10. int lastDigit = x % TEN;
  11. while (firstDigit >= TEN) {
  12. ++countNoDigit;
  13. firstDigit /= TEN;
  14. }
  15. if (a == countNoDigit && b == firstDigit && c == lastDigit) {
  16. cout << "DA";
  17. } else {
  18. cout << "NU";
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5280KB
stdin
4 2 3 2233
stdout
DA