Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. //#include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. //ifstream fin("pozitie.in");
  7. //ofstream fout("pozitie.out");
  8.  
  9. int main()
  10. {
  11. int n;
  12. cin >> n;
  13. int x[101], adv = 0;
  14. for(int i = 1;i <= n;i ++)
  15. cin >> x[i];
  16. for(int i = 2;i < n && adv == 0;i ++)
  17. if((x[i - 1] % 2 == 0 && x[i] % 2 == 0 && x[i + 1] % 2 == 0) || (x[i - 1] % 2 == 1 && x[i] % 2 == 1 && x[i + 1] % 2 == 1))
  18. adv = 1;
  19. if(adv)
  20. cout << "DA";
  21. else
  22. cout << "NU";
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement