Advertisement
CotoiRares

Untitled

Nov 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,cf,poz=-1,copcf=-1;
  8. bool ok=true;
  9. cin>>n;
  10. while (n!=0)
  11. {
  12. cf=n%10;
  13. n=n/10;
  14. poz++;
  15. if (poz%2==1)
  16. {
  17. if (cf<copcf)
  18. {
  19. ok=false;
  20. break;
  21. }
  22. copcf=cf;
  23. }
  24. }
  25. if (ok==true)
  26. cout<<"DA";
  27. else
  28. cout<<"NU";
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement