fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int n, firstDigit, secondDigit, thirdDigit;
  8. cin >> n;
  9. thirdDigit = n % TEN;
  10. secondDigit = n / TEN % TEN;
  11. firstDigit = n / TEN / TEN;
  12. if (firstDigit == secondDigit - 1 && firstDigit == thirdDigit - 2 &&
  13. secondDigit == thirdDigit - 1) {
  14. cout << "SUNT";
  15. } else {
  16. cout << "NU SUNT";
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5268KB
stdin
430 
stdout
NU SUNT