fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int a, b, c;
  8. cin >> a >> b >> c;
  9. int lastDigitA = a % TEN;
  10. int secondLastDigitB = b / TEN % TEN;
  11. int thirdLastDigitC = c / (TEN * TEN) % TEN;
  12. if (lastDigitA % secondLastDigitB == 0 && secondLastDigitB % thirdLastDigitC == 0) {
  13. cout << "DA";
  14. } else {
  15. cout << "NU";
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
NU