Advertisement
CotoiRares

Untitled

Dec 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,v[101],i,ant,g=0,ok=1;
  8. cin>>n;
  9. for (i=1;i<=n;i++)
  10. cin >> v[i];
  11.  
  12. for (i=1;i<=n;i++)
  13. {
  14. if (v[i]%2==0)
  15. {
  16. if (g==0)
  17. {
  18. ant=v[i];
  19. g=1;
  20. }
  21. else
  22. {
  23. if (v[i]<ant)
  24. {
  25. ok=0;
  26. break;
  27.  
  28. }
  29. }
  30. ant=v[i];
  31. }
  32. }
  33.  
  34. if (ok)
  35. cout << "DA";
  36. else
  37. cout << "NU";
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement